0

I'm using Google Vision API via curl (image is sent as base64-encoded payload within JSON). I can get correct results back only when my request sent via CURL is under 16k or so. As soon as it's over ~16k I'm getting no response at all:

no response returned

Exactly the same request but with a smaller image all good here

I have added the request over 16k to pastebin:

{
  "requests": [
    {
      "image": {
           "content": ...base64...
 ....
}

Failing request is here: https://pastebin.com/dl/vL4Ahfw7

I could only find a 20MB limitation in the docs (https://cloud.google.com/vision/docs/supported-files?hl=th) but nothing like the weird issue I have. Thanks.

user1552175
  • 178
  • 10
  • I tried to use your pastebin code, but it seems that the `content` value is not well formed. I've just made a [512K file](https://pastebin.com/raw/yb6zLqtx) request and I didn't have any issues with the response. – F10 Sep 24 '18 at 15:42
  • @F10, interesting, I'm getting the same issue with your request (no response received). Can you please post your full curl command line? – user1552175 Sep 28 '18 at 23:06
  • 1
    In case anyone comes across a similar issue: it only seems to happen on Windows (looks like the server is waiting for more data and eventually sending HTTP 408 complaining about the client request taking too long). I ran the same command on Ubuntu with the same content and got a successful response. I have then built a simple C app using libCURL: loading a file and supplying contents to CURLOPT_POSTFIELDS. It works totally fine on Windows + it was useful to add base64 support to it to simply the usage further. – user1552175 Sep 30 '18 at 18:46

0 Answers0