Wednesday 13 May 2009

curl for HTTPS (and Twitter)

curl is a powerful library available on different platforms - I use it on Linux debian.

You can use it just to get http pages, or to post data and get a response from a server.
HTTPS is available too.

An example:

curl -k --data @request.xml

posts the XML data contained by request.xml using a HTTPS connection (and ignoring invalid certificates, option '-k' - just for testing purposes).

This is a more interesting usage: it's nice to get info from Twitter or even send messages ("update your status") with just a command line:

Get status:

Send a message:
curl -u user:password -d "status=describing how to use the Twitter API"

To install curl on debian:

apt-get install libcurl3

(install dependencies too, and I suggest to include libcurl3-gnutls-dev)

No comments:

Post a Comment

About ICE negotiation

Disclaimer: I wrote this article on March 2022 while working with Subspace, and the original link is here: