How do I do a simple post to the cloud ocrsdk in Delphi? First attempt is below, which results in 'Invalid argument to date encode'.

procedure TForm1.Button1Click(Sender: TObject);  
var  
  url,res:string;  
  sl:TStringList;  
  ReqStrm : TIdMultiPartFormDataStream;  
  auth:Tidauthentication;  
begin  
  ReqStrm := TIdMultiPartFormDataStream.create();  
  http.Request.ContentType := 'multipart/form-data';  
  reqStrm.AddFormField('ApplicationId','My Application ID');
  reqStrm.AddFormField('ApplicationPassword','my password');
  reqStrm.AddFormField('Language','English');  
  reqStrm.AddFile('body','C:\Path to file\Page_03.tif','image');  
  url := 'http://cloud.ocrsdk.com/processImage?language=english&exportFormat=rtf';

  res:=http.post(url,reqStrm);  
  memo1.Lines.Add(res);  
  reqStrm.Free;  
end;

asked 17 Feb '14, 08:44

Bryn%20Lewis's gravatar image

Bryn Lewis
1112

edited 19 Feb '14, 17:18

Anastasia%20Galimova's gravatar image

Anastasia Ga... ♦♦
790112


Unfortunately, now we have not enough time to create a sample code in Delphi. If you create a sample yourself, we would be grateful to share it.

In the provided code wrong content type is specified: it is necessary to use the REST API instead of forms. The following links could be helpful:

link
This answer is marked "community wiki".

answered 19 Feb '14, 17:17

Anastasia%20Galimova's gravatar image

Anastasia Ga... ♦♦
790112

Dear Support team's members! I would like to ask you to find couple of minutes to make sample code in Delphi:) The links you provided did not help to solve.

(04 Aug '15, 10:18) spice_miv

We are sorry but at the moment we do not have resources for creating a new code sample in Delphi. We have created the corresponding reclamation.

(06 Aug '15, 07:08) Oksana Serdyuk ♦♦
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×2
×2

Asked: 17 Feb '14, 08:44

Seen: 3,697 times

Last updated: 06 Aug '15, 07:08

© 2016 ABBYY. All rights Reserved. www.ABBYY.com | Privacy Policy | Legal