How to send Raw http for Instagram Authentication?
See original GitHub issueI’m trying to connect to the Instagram API with axios.
Here’s my code:
axios( {
method: 'POST',
url: '/oauth/access_token',
baseURL: 'https://api.instagram.com',
params: { // both data and params don't work
'client_id': 'CLIENT_ID',
'client_secret': 'CLIENT_SECRET',
'grant_type': 'authorization_code',
'redirect_uri': 'REDIRECT_URI',
'code': 'CODE',
},
} )
I keep getting the response No client_id
so it’s not reading any of the params.
When I use restify’s StringClient
return new Promise( function ( resolve, reject ) {
client.post( '/oauth/access_token', {
'client_id': 'CLIENT_ID',
'client_secret': 'CLIENT_SECRET',
'grant_type': 'authorization_code',
'redirect_uri': 'REDIRECT_URI',
'code': 'CODE',
}, function ( errr, reqq, ress, dataa ) {
if ( errr ) {
reject( errr )
} else {
resolve( dataa )
}
} )
} )
It works great.
I think it has something to do with application/x-www-form-urlencoded
header maybe?
I would like to know how I can get this working with axios. Thank you!
Issue Analytics
- State:
- Created 7 years ago
- Comments:17 (4 by maintainers)
Top Results From Across the Web
Turn on two-factor authentication
Two-factor authentication is a security feature that helps protect your Instagram account ... Text message: We'll send a login code to your mobile...
Read more >PHP How To Send Raw HTTP Packet
im trying to emulate the raw packets that i captured using wireshark. but i keep getting "auth needed" or "request denied" responses :(...
Read more >windows - utility program for issuing raw HTTP commands?
Sends some data via POST, as well as some arguments via GET to a specific URL. -q means don't give me progress updates,...
Read more >HTTP Headers for Dummies - Code - Envato Tuts+
POST : Send Data to the Server · The path in the first line is simply /foo.php , and there is no query...
Read more >Unsplash API Documentation | Free HD Photo API
The Unsplash API uses HTTP verbs appropriate to each action. ... raw returns a base image URL with just the photo path and...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yes, StringClient uses the
application/x-www-form-urlencoded
format by default while axios usesapplication/json
by default (whendata
is an Object).Here is how to make an
application/x-www-form-urlencoded
request with axios:Browser
URLSearchParams
as described here: https://github.com/mzabriskie/axios/issues/97#issuecomment-223650368Node
You can use
querystring
module to encode the data:Hope this helps!
You can patch axios to use application/x-www-form-urlencoded Solution here: https://github.com/axios/axios/issues/97