简体   繁体   中英

Retrieve Response query using node-fetch

One day I was busy using node-fetch to make an HTTP Request , and tried to retrieve the Response Text. When using Chrome Dev Tools , you can get this information in the Response tab. Like This: 在此处输入图像描述

The method of request does not matter.

I am trying to access the response text shown in the Response tab, using node-fetch. Any idea how or if it is possible to achieve this? If not, could you provide me with a module that could do this? The provided module must be able to do most types of HTTP requests, as well as being lightweight.

Thanks in advance.

I've found this piece of software very useful. I use dev tools a lot, and it definitely has its place, but for diagnosing responses, particularly big responses, I use postman.

https://www.postman.com/

I use it for gets, puts, posts etc, it will even give you code samples of your request in quite a few different languages.

It requires a gmail account. It is somewhat lightweight, i run it server side as well as clientside. It has been a lifesaver for diagnosing request headers/ responses.

Here is an example pic.

在此处输入图像描述

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM