The other day, I found myself making some changes to a network request for our application. Plug in silhouette connect free.
1) Open the network tab in DevTools 2) Ctrl-click a request, 'Copy as cURL'. 3) Paste it in the curl command box.
By navigating to a specific page, I knew I’d trigger the call, so that’s what I was doing. At some point, I needed some help and one of the more senior engineers made a comment that I could just copy the cURL
into Postman.
CURL to Postman Postman is a fantastic tool for testing any HTTP endpoint. But if you're using your browser to look around and you find something of interest it can be a pain to recreate the request in Postman and copy across all the headers. There must be a better way! Curl is a command-line tool for Linux, Windows, and macOS that can be used to send requests to the server. With Curl you can transfer files to or from the server, post forms and make your own curl requests with any headers and data. Generate Code Snippets for Convert Curl HTTP Request Example. Typeform, Bukalapak, and PedidosYa are some of the popular companies that use Postman, whereas cURL is used by Kosada, mytaxi, and immmr. Postman has a broader approval, being mentioned in 1755 company stacks & 2238 developers stacks; compared to cURL, which is listed in 5 company stacks and 7 developer stacks.
How To Use Postman Chrome
Import Curl To Postman
I didn’t know what that meant, so I did some digging. Here are the why and how to use Postman for your API testing.
Php Curl To Postman
Moving the process to Postman, I get several benefits. The two biggest for me are:
- I speed up my testing cycle - since I don’t have to load the entire page, but can focus on just my one call, each test can be done much more quickly
- Inspecting the response is easier - I don’t have to navigate through the network tab in Dev Tools each time to find the call I’m interested in, but can use Postman’s UI which is much more suited to the process
- Navigate to the web page that you know will trigger the network call
- Open the Dev Tools (The Mac keyboard shortcut for Chrome is
⌘
+⌥
+i
) - Go to the Network tab
- Find the request that you’re interested in replicating, and right click on it. The
cURL
can be found in Copy> Copy as cURL - Open up Postman
- Use Postman’s Import functionality and paste the copied request into the Raw text section, File > Import > Raw Text. (The keyboard shortcut is
⌘
+o
)Note, by copying thecURL
, you will also bring in all of your headers - including any authorization that may be necessary.