iOS 7 Status code in(200-299) got 401

  • 6.4K Views
  • Last Post 11 March 2014
Leo Ye posted this 03 March 2014

Hi,all,

I am trying to develope an iOS application with ABBYY OCR SDK sample code. I changed OCRDemoClient.m file with my applicationID and application password recieved by email. Because I want this application run on version 7, so I fixed some depreciated methods with latest version methods. Now, the sample code can be built successful in Xcode stimulator and iPhone devices. But when I use it to recognize the sample picture, it causes error :Expected status code in (200-299), got 401. It seems that this error caused by unauthorized client request over http request. But I am new to object C, I can't find how to fix this problem. Is there anyone has the same problem? Any suggestions are more than welcome!

Regards, Leo.

Order By: Standard | Newest | Votes
Anastasia Galimova posted this 04 March 2014

Our developer recommends to use HTTP debugger (Fiddler, Wireshark or any other) to check if you send the right http-request.

  • Liked by
  • Leo Ye
  • Vitalik Kudryavcev
Leo Ye posted this 11 March 2014

Hi, Anastasia, I still have some questions:

1)I followed the instructions to set up pod files, the Podfile is using "(platform :ios, "5.0" pod "OCRSDKClient", "0.2.1")", could it be changed to ios 7.0? Does the "OCRSDKClient" podfile works for ios 7.0?

2)Do I need to change some core code in the sample code(AFHTTPClient.m or AFHTTPRequestOperation.m) except providing my credentials to connect to Cloud OCR SDK.

3)I tried to dubug the http-request with Charles, It seems that it connects URL: http://cloud.orcsdk.com/activateNewInstallation?deviceId=(Xcode Stimulator ID) Status: Completed Response Code: 401 Unauthorized Is it possible that this error 401 is related with device ID??

4) Where the sample code sents the picture to OCR Cloud SDK? and Where the sample code receives the returned text? Could you list the filename and which line?

Maybe these questions are stupid, but I have been debugging this problem since last monday, but I can't solve this problem. Any help will be appreciated.

Leo Ye posted this 11 March 2014

Now, the error was fixed!! It turns out that my application was Block after resetting the password.

Thank.

Anastasia Galimova posted this 11 March 2014

We are happy to know that the issue is solved.

Close