1

I'm downloading a free font but I want to automate this process with a cURL command.

I've tried looking in the timeline in Safari, but I can't see the request go through.

I did, however, see in the html that the form has an action="/build/" attribute. So I tried this:

$ curl http://input.fontbureau.com/build/

But I get the response:

You did not accept the terms of the license.

I saw the checkbox has a name="accept" value="I do" so I tried wrapping that into a cURL request (I've never done this before) like this:

curl --data "accept=I\do"  http://input.fontbureau.com/build/ -o font

This seems be downloading something, but what remains is not a directory with the expected files in it.

Anyways, I've had to do far more digging than I think is necessary to get this far. Shouldn't I be able to just see the request going out somewhere in the dev tools of some browser (Chrome, Safari, Firefox)? I saw the request on the time in Safari, but this is all it said:

input.fontbureau.com    resource-type-document  GET HTTP    200         10135428        0.11966300010681152 0.0011889934539794922

Is there some way to see a request in the dev tools that I can easily translate into a cURL request that will work?

Chet
  • 18,421
  • 15
  • 69
  • 113
  • You must send user-agent information in the HTTP header to pretend to be a browser. You may also need to send and receive POST/GET/COOKIE/SESSION data, and follow redirects as well. Sometimes you must even extract "unique" data from the page to submit certain forms etc. – Horse SMith Nov 19 '14 at 00:16
  • I see. That makes sense. Couldn't I see this data all in the post request though? – Chet Nov 19 '14 at 01:16
  • http://stackoverflow.com/questions/356705/how-to-send-a-header-using-a-http-request-through-a-curl-call I totally forgot to mention that you may in some cases also need to send the referral too, like from what page you were directed there at. Important in some form data submit cases. – Horse SMith Nov 19 '14 at 01:33

0 Answers0