I'm doing some stuff with Facebooks FQL at the moment, and I'm using
curl on the command line to test some of the responses of it. I'm also using
export to keep the params seperated for easy editing. But I'm doing something wrong, and I can't see what.
This produces a perfectly fine result (even with the export):
export FB_TOKEN="the_access_token" curl -F access_token=$FB_TOKEN -F query="SELECT first_name FROM user WHERE uid=12345678910123" https://api.facebook.com/method/fql.query
But this does mess up:
export FB_TOKEN="the_access_token" export FB_QUERY="SELECT first_name FROM user WHERE uid=12345678910123" curl -F access_token=$FB_TOKEN -F query=$FB_QUERY https://api.facebook.com/method/fql.query
and produces the following output:
curl: (6) Couldn't resolve host 'first_name' curl: (6) Couldn't resolve host 'FROM' curl: (6) Couldn't resolve host 'user' curl: (6) Couldn't resolve host 'WHERE' curl: (6) Couldn't resolve host 'uid=100001273321556' <?xml version="1.0" encoding="UTF-8"?> (...further response that the request was invalid here...)
I don't see anything I forgot to escape. Why does
curl insist on interpreting these as hosts?
Used software versions:
curl 7.21.3; bash 4.2.8(1)