04-16-2018
11:34 AM
- last edited on
11-06-2024
04:24 PM
by
Content Cleaner
I need to make a HTTP Post request with a large file. I'd like to have a small timeout (~10s) if the connection doesn't establish and a longer timeout (~60s) if the whole request doesn't complete.
For those familiar with curl, this is analogous to --connect-timeout and --max-time command line options.
From https://www.ni.com/docs/en-US/bundle/labview-api-ref/page/vi-lib/httpclient/post-vi.html it seems I can only implement the latter timeout. Is there a way to timeout on connection as well?
There's a defer to OS option, does NI Linux expose a way to do this?
Regards,
David
04-16-2018
12:57 PM
- last edited on
11-06-2024
04:25 PM
by
Content Cleaner
I think your best option may be using a HEAD connection first with a short timeout, and then if that succeeds do a POST connection with a long one.
Sends a Web request that returns headers from a server, Web page, or Web service. This VI uses the HEAD HTTP method. This VI does not submit any data to the server or receive body data. The minimal data exchange makes the HEAD VI useful for testing the validity of a URL.