I have tested my user name and password in the ios app and it works. When i am trying to implement the http request, I get a 401 error. I am using Parse cloud code, but it is very similar to javascript.
I don't understand what the documentation means by "Authorization: Basic <applicationid:applicationpassword>" *I have tried to put the username and password in URL: url : "http://APPID:PASS@cloud.ocrsdk.com/submitImage", method : 'POST', body : image.buffer,
- I have tried adding the line as a header: url : "http://cloud.ocrsdk.com/submitImage", method : 'POST', body : image.buffer, headers: { 'Authorization' : 'Basic AppId:password', }, Can someone clarify?
Comments
1 comment
In the C# sample you can find what header should be specified.
I don't know how exactly it should be done in your development environment, probably in the same way as in JavaScript sample.
You should make sure that the request has the correct header and body (in particular, that it is encoded in base64). You can use HTTP debugger for this task (Fiddler or any other that is suitable for your platform).
Please sign in to leave a comment.