Client Credentials Jquery get method
-
Hi Team,
I am developing a API using Jquery Ajax Call method to call post of my sites.
I am using “oauth wordpress plugin” to authenticate the Get Call using “Client Credentials ” method however it does not return anything.
My code is :$('document').ready(function() { var request = $.ajax({ url: "http://measinki.com/wp-json/wp/v2/posts", type: "GET", connection: "keep-alive", crossDomain: true, username:"my-Client ID", password:"My-secret-key", contentType: "application/json", mimeType: "application/json", headers:{ 'Access-Control-Allow-Origin': '*', "Access-Control-Allow-Headers": "Content-Type, Access-Control-Allow-Headers, Authorization, X-Requested-With" } }); request.done(function(msg) { console.log(msg); });I do receive error in Console ” Request header field Access-Control-Allow-Origin is not allowed by Access-Control-Allow-Headers in preflight response.”
Any help will appreciated.
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
The topic ‘Client Credentials Jquery get method’ is closed to new replies.