How do I set headers in HTTP client?

Hi,

Since the Rest client has been removed, I now have to use the HTTP client to test my API requests. But I'm struggling to figure out how to send an 'auth-token' in the HTTP header for my GET request. This is easy to do in Postman as there's a 'headers' section - doesn't seem to be the case with the HTTP client in PHPStorm.

Can anyone advise please?

Many thanks

Kevin

1
3 comments

Please use following syntax:

Method Request-URI HTTP-Version
Header-field: Header-value

Request-Body

 

Isn't 'auth-token' being automatically sent/generated by remote service using a client id and client secret?

2

Got it, thanks Dmitry, that works now. I'm getting the token via an initial get request which sends an email and password in a json object in the body, that returns the token - I'd already got that working, it was just the header bit I didn't know how to do.

Kevin

1

Cool, thanks for letting me know :)

0

Please sign in to leave a comment.