Skip to content
Advertisement

in Ajax, how to write “headers” for multiple condition?

as a beginner, I have some problems in using Ajax (with Discogs API) .. to get a discogs request token, discogs is saying

JavaScript

https://www.discogs.com/developers#page:authentication,header:authentication-discogs-auth-flow

but, how to write this header? below is my trying code, but I know this is not proper.

JavaScript

Advertisement

Answer

You said:

JavaScript

It isn’t possible to specify headers for JSONP requests.

The API can’t be using JSONP. Set the dataType to the format they are using.


The documentation says:

When you create a new application, you’ll be granted a Consumer Key and Consumer Secret, which you can plug into your application and start making authenticated requests. It’s important that you don’t disclose the Consumer Secret to anyone.

Putting those in your client-side code will disclose them to all your visitors.

The request to that end point should be made from server-side code.

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement