Curl returning with no response and does not wait for `wait=x seconds`
1
vote
1
answer
11330
views
I call an async service that takes ~80 seconds to respond. I run:
curl -v -X POST https://hostname.com/service/v2/predict \
-H 'x-api-key: somekey' \
-H 'x-request-id: longfiles' \
-H "Authorization: Bearer dfv651df8fdvd" \
-H 'Prefer: respond-async, wait=200' \
-F 'contentAnalyzerRequests={"inputtest": "this is a test"}
-F infile=@/mnt/file/stream-01865caa-b2e0-40e4-b298-1502fcc65045.json
The command specifies wait=200
but curl returns in ~60 seconds. And since the service takes ~80 seconds to respond, I get no response (but I do get a response if I use wait=1000
). Why?
---
Output of the curl query with -v
:
> Prefer: respond-async, wait=200
> Content-Length: 19271573
> Expect: 100-continue
> Content-Type: multipart/form-data; boundary=------------------------5873f0b92dd68547
>
< HTTP/1.1 100 Continue
< HTTP/1.1 202 Accepted
< Server: openresty
< Date: Fri, 07 Oct 2022 21:55:33 GMT
< Content-Length: 0
< Connection: keep-alive
< x-request-id: longfiles
< vary: Origin,Access-Control-Request-Method,Access-Control-Request-Headers
< location: https://hostname.com/service/v2/status/longfiles
< retry-after: 1
< Access-Control-Allow-Origin: *
< Access-Control-Allow-Headers: Authorization,Content-Type,X-Api-Key,User-Agent,If-Modified-Since,Prefer,location,x-transaction-id,retry-after,cache-control
< Access-Control-Allow-Methods: GET, POST, PUT ,DELETE, OPTIONS,PATCH
< Access-Control-Expose-Headers: location, retry-after, x-request-id, x-transaction-id, cache-control
< Access-Control-Max-Age: 86400
<
* Connection #0 to host hostname.com left intact
Asked by Franck Dernoncourt
(5533 rep)
Oct 7, 2022, 09:25 PM
Last activity: Oct 10, 2022, 08:26 AM
Last activity: Oct 10, 2022, 08:26 AM