Issue
I'd like to be able to copy any HTTP request from the Network tab in Chrome Developer Tools and resend it from within node.js code as an Axios request. (Have tried node-fetch but found Axios better in several important ways). However, Chrome only has the following options for copying requests: Copy as Powershell, Copy as fetch, Copy as node.js fetch, Copy as cURL (cmd), Copy as cURL (bash). It doesn't include an Axios option.
Have come across a couple of online tools that will convert cURL requests:
- https://curl.trillworks.com/ <== converts from cURL with options for Ansible, Browser (fetch), Dart, Elixir, Go, JSON, Node.js (fetch), Node.js (request), MATLAB, PHP, Python, R, Rust or Strest
- https://onlinedevtools.in/curl <== converts from cURL with a subset of the options above: Go, JSON, Node.js, PHP, Python, R, Rust or Strest
But unfortunately neither of these have an option for Axios. I also haven't been able to find an npm package that would do the conversion. It needs to be repeatable so not sure what the best option would be but it can't just be a manual conversion - grateful for any suggestions.
Solution
You can use postman and you can convert cURL to several languages.
Answered By - Ever Answer Checked By - Robin (PHPFixing Admin)
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.