How to send an Authorization TOKEN and parameters to perform an INSERT in my API?

Asked

Viewed 227 times

2

My API works correctly. I can enter data into the database through it with POSTMAN, but I would like to do this in c#.

inserir a descrição da imagem aqui

This second image is from the creation of a token of mine. inserir a descrição da imagem aqui

  • Please do not post code as image. Always use text.

1 answer

2


Just like in POSTMAN, you need to send this token in a header of the requisition.

client.DefaultRequestHeaders.Authorization 
                     = new AuthenticationHeaderValue("Bearer", "token da API");

Browser other questions tagged

You are not signed in. Login or sign up in order to post.