I'm trying to send a GET request with a token authentication, but i get an unauthorized response. If i send the same request on Postman, it works.
Here's my code :
string url = string.Format("{0}batchs", MyUrl);
RestClient client = new RestClient(url);
RestRequest getRequest = new RestRequest(Method.GET);
getRequest.AddHeader("Accept", "application/json");
getRequest.AddHeader("Authorization", "token " + MyToken);
getRequest.AddParameter("name", MyName, ParameterType.QueryString);
IRestResponse getResponse = client.Execute(getRequest);
And here's my postman request :
Any ideas on how to correct this ?
Thanks !
I'm not sure exactly what kind of auth you're using, but I use a firebase token generated at runtime, and this is the only thing I could get to work for me.
request.AddHeader("authorization", "Bearer " + _fireBaseService.AuthToken);