What does “curl” mean?
I’m developing Facebook JavaScript apps on a daily basis, but keep stumbling into some code snippets I don’t understand, on the Facebook Documentation, and other websites I visit.
I searched Google for CURL, and found some descriptions about it. I can’t figure out how Facebook wants me to use it.
curl -F "title=Example Title" -F "description=Description" \
-F "start_time=1329417443" \
"https://graph.facebook.com/PAGE_ID/milestones?access_token=_"
It’s nonsens for me. Can you help me understand in what context I can use it for Facebook , and maybe in general, and guide me in the right direction where to find more on the subject?
curl is a command line utility that lets you send an HTTP request. It can be very useful for developing with web service APIs. I believe it comes pre-installed with most linux distros but you would need to download and install it for Windows. (It probably comes with Cygwin but can be installed on its own as well.)
I would suggest making sure it’s directory is added to your PATH environmental variables. Again, probably not a problem in linux but you will need to do this manually in windows.
curl
is a command to fetch requests. The -F
(--form
) argument is used to specify form POST parameters.
Citation from man curl
:
-F/--form <name=content>
(HTTP) This lets curl emulate a filled-in form in which a user
has pressed the submit button. This causes curl to POST data
using the Content-Type multipart/form-data according to RFC
2388. This enables uploading of binary files etc. To force the
'content' part to be a file, prefix the file name with an @
sign. To just get the content part from a file, prefix the file
name with the symbol <. The difference between @ and < is then
that @ makes a file get attached in the post as a file upload,
while the < makes a text field and just get the contents for
that text field from a file.
curl
is a way of fetching items. The -F
is one of many parameters…
http://curl.haxx.se/docs/manpage.html
Also:
Have you seen http://developers.facebook.com/docs/reference/api/batch/
and it could be useful for something like:
of course FB docs use curl to show a common basic way to perform the request … it depends on what platform language libraries are you using the actual way to perform the graph http request
…so that if you are Facebook JavaScript developer you have to use XMLHttpRequest (or i suppose facebook js lib calls)