reqwest icon indicating copy to clipboard operation
reqwest copied to clipboard

how can i get response head

Open gx191179173 opened this issue 5 years ago • 3 comments

gx191179173 avatar Apr 17 '19 02:04 gx191179173

how can i get the response head

gx191179173 avatar Apr 17 '19 02:04 gx191179173

i don't know

qq292 avatar Aug 01 '19 20:08 qq292

Hi @gx191179173, @qq292,

after quick reading through the souces: It should be

resp.getResponseHeader

Bit better example looks like this: reqwest({ url: 'path/to/json' , type: 'json' , method: 'post' , error: function (err) { } , success: function (resp) { // resp.getResponseHeader // just print resp console.log(resp); } })

After console.log(resp) you will see in the output what's inside the response. Then you can simply select the data needed for your usecase.

Hope this helps :) Happy Codin' ! ~Jan-Stefan

jan-stefan avatar Aug 02 '19 07:08 jan-stefan