7
$\begingroup$

I only need to know whether a specific call returns 200 but:

URLFetch[
    "http://exampledata.wolfram.com/10mb.dat"
  , "StatusCode"
] // AbsoluteTiming
{15.141, 200}

So it clearly downloads whole 10MB. Similar curl command returns almost instantaneously:

 curl -I http://exampledata.wolfram.com/10mb.dat

so it is clearly possible. How to do this so it will work on every V10+ installation?

$\endgroup$
8
$\begingroup$
URLFetch["http://exampledata.wolfram.com/10mb.dat", "StatusCode", 
  Method -> "HEAD"] // AbsoluteTiming

{0.383878, 200}

$\endgroup$
  • $\begingroup$ +1 for good dig.Though the color is red,it's seem also serve for URLRead.And I'm in 11.1. $\endgroup$ – yode Apr 20 '17 at 8:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.