Calling Google Protocol RPC API in Browser via JavaScript

336 views Asked by At

I'm trying to access a Google Protocol RPC API with jQuery like this:

jQuery.ajax({
    url: some_url,
    type: "POST",
    data       : some_params,
    contentType: "application/json; charset=utf-8",
    dataType   : "json",
    success    : function (data) {
            console.log(data);
        },
    error      : function (xhr, status, errorThrown) {
        console.log(xhr);
    }
});

But I only get the following error message:

XMLHttpRequest cannot load https://*****. Response for preflight has invalid HTTP status code 400 

How can I return an OPTIONSmethod in ProtoRPC, that I don't get this error anymore?

0

There are 0 answers