I use request module to make post request (Coffeescript):

request
    method: 'POST'
    uri: "http://cloud.ocrsdk.com/processImage"
    headers:
        Authorization: 'Basic: ' + new Buffer("#{id}:#{password}").toString 'base64'
    qs:
        language: 'russian'
        imageSource: 'scanner'
        exportFormat: 'xml'
    body: file_content
But I get response 551 "Unsupported image file format". How I must send file? How your server know, which format file have? Must I specify file format anywhere? How must http package look like?

I learn samples (.net and python), watch traffic with WireShark, and try to do the same on nodejs, but it does not work.

asked 18 Aug '12, 16:33

log0div0's gravatar image

log0div0
2114

edited 20 Aug '12, 09:51

Vasily%20Panferov's gravatar image

Vasily Panferov ♦♦
5422516


You can also take a look at a third-party library in coffeescript to access cloud ocr sdk: https://github.com/selead/node-ocr

link

answered 20 Aug '12, 09:50

Vasily%20Panferov's gravatar image

Vasily Panferov ♦♦
5422516

Problem solved. file_content must be a Buffer object, not String.

link

answered 19 Aug '12, 15:21

log0div0's gravatar image

log0div0
2114

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:

×59
×28
×2
×1

Asked: 18 Aug '12, 16:33

Seen: 3,479 times

Last updated: 20 Aug '12, 09:51

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