You can use guzzle as an http client to do the requests ( https://github.com/guzzle/guzzle ). In order to set a header in your request you can do seomthing like:
@MANELGAVALDA - So I'm not wrong, Laravel doesn't provide any library for that. It's really strange, because in the test framework almost all resquest kind are available.
@OCTAL - I think something like guzzle it's not available by default, because not in every application you need to call external APIs, and it's so easy to install it, in case you need it.
For exemple axios is already shipped with laravel as a npm dependency (and already configured to work) because you need axios in order to make api calls to your own server.
So unless you want to use javascript (axios) to make the calls, you will need to install something like guzzle.
@octal Testing requests aren't "real" requests sent by an http client.
Laravel automaticaly build a SymfonyRequest and send it to HttpKernel of your application.
Thank you.
I'm using Guzzle v6 and it's working very well. I have had to setup Wampserver curl extension to use the correct cacert.pem from mozilla website because I was calling an https url and I was gotting the famous error
cURL error 60: SSL certificate: unable to get local issuer certificate