✅ api response 401
hey, I'm trying to use nlpcloud to translate text
there is curl example:
I wrote following
nlpclient
:
everything should be good but I get 401 in res
whats wrong with my code?11 Replies
client.DefaultRequestHeaders.Add("Authorization", _apiKey);
does _apiKey
have the "Token" prefix?
or just the token?no, just a set of numbers and letters
ok, I will add "Token"
well, looking at your curl example, the header value should be
Token <token here>
not just <token here>
now api returns only the status code 400
400 is Bad Request
I would use the debugger, and see what
payload
ismaybe my model is a problem idk..
that's my guess
the casing might be incorrect
but it looks as in example case
hm
no that should be fine...
I'd grab something like https://www.telerik.com/fiddler/fiddler-classic
and compare the request made by curl, and by your app
Telerik.com
Fiddler Classic | Original Web Capturing Tool for Windows
The community-trusted Windows-only web capture tool that logs HTTP(s) network traffic. Use Fiddler Classic to capture requests and responses.
okay I will try, thanks
the problem was here:
source="eng_Latn",
target="spa_Latn"