Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

View and Set HTTP headers for Safari/Chrome

I'm testing an API and I would like to hit it with safari and see the raw json that's returned. The API requires a certain HTTP header be sent with every request. Is there a way in Safari or Chrome to set my http headers when visiting a URL?

like image 479
Christian Schlensker Avatar asked Aug 17 '11 18:08

Christian Schlensker


People also ask

How do I view HTTP headers in Safari?

Turn on the "Develop" menu in Safari Preferences, then choose "Show Web Inspector" from the "Develop" menu. Click "Resources". Select the resource you want to inquire about and click "Headers". Thanks for that.

How do I edit HTTP headers in Chrome?

Modify Headeropen Chrome developers toolbar Option + ⌘ + J (on macOS), or Shift + CTRL + J (on Windows/Linux). Press Command+Shift+P (Mac) or Control+Shift+P (Windows, Linux, Chrome OS) to open the Command Menu. In the User agent section disable the Select automatically checkbox.


2 Answers

There are a couple Google Chrome apps that do this. One is called Rest Console. I actually found an app called GraphicalHttpClient in the Mac AppStore that's a lot easier and more enjoyable to use.

like image 135
Christian Schlensker Avatar answered Oct 07 '22 00:10

Christian Schlensker


Another popular chrome app for this is is Postman

like image 34
Myster Avatar answered Oct 06 '22 22:10

Myster