Making HTTP calls from inside Rider

I test my code with API calls all the time. Because of this, Rider HTTP Client is a lifesaver.
Usually, I call some endpoint for a token and then try to get some data from the service. So let's try to use Rider for this case.

First, we have to run the client. We can do it from the tools menu.

rider_http_client.png After that, it will pop up with an example request. Let's first get a token from the service that we can use in subsequent calls. You can do it like so:

Content-Type: application/json

  "email": "",
  "password": "pistol"

> {%"access_token", response.body.token); %}

This call will send a POST request to and save the token in a global variable called access_token.

Now let's get some data:

Authorization: Bearer {{access_token}}
Accept: application/json

And that's all. We can call our services without getting out of the IDE.
Simple, isn't it?

What's more, you can check a file with requests into your repository to always have them within reach.