Get the response headers from redirect url using node.js -


objective: te response.headers when status code 302 redirects uri response

issue:

i did bit of googling issue i'm facing @ end redirect url returning 500 rather expected 302. found npm request() can used redirects. i'm not able response headers returns 500. when used api end points manually postman (with interceptors turned on) along body , headers, able 302 redirects. used automation testing api

  request(   url: 'https://blah/blah',   client_id:'something.com.au'   redirect_uri:'http://something' // used mobile app , ok have valid url   response_type :'code'   scope : 'allapi',   username : 'cxxx'   password : 'ccxcxc'   headers : {      'content-type': 'application/x-www-form-urlencoded',      'followredirect' : true   }, function (error, response) {              console.log('the response val is', response.statuscode);     }); 

question: not sure if npm request can justice or using request in-correctly or should have use axios/follow-redirects etc.. that. please advise. if can provide proper directions on this, it'll helpful

thanks, brad

@all. i've resolved using form property using req.post() method returned statuscode 302 response headers. once again.


Comments

Popular posts from this blog

c# - How Configure Devart dotConnect for SQLite Code First? -

c++ - Clear the memory after returning a vector in a function -

erlang - Saving a digraph to mnesia is hindered because of its side-effects -