I have a API that work but the client app calling is is getting an error and is looking for a results key.
Can someone please tell me how to add this to the API?
I'm using Visual Studio 2019 and this is a ASP.NET API project (not core).
Thank you.
I have a API that work but the client app calling is is getting an error and is looking for a results key.
Can someone please tell me how to add this to the API?
I'm using Visual Studio 2019 and this is a ASP.NET API project (not core).
Thank you.
Hi @moondaddy-8531,
but the client app calling is is getting an error and is looking for a results key
What is the error you encountered?Is it a 401 error?
Did you enable authentication in WebAPI?
If you use authentication in WebAPI, then when you send a request from the client, you need an authorization request header with credentials.
Do you want to send API Key from the client?If this is the case, you can write:
$.ajax({
type: 'GET',
url: 'xxxxxx',
headers: {
"APIKey":"APIKeyValue"
}
});
var client = new HttpClient();
client.DefaultRequestHeaders.Add("APIKey", "APIKeyValue");
If the answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
Best Regards,
YihuiSun
2 people are following this question.