Today we want to present HTTPicus, a simple library to execute http requests to a remote server easily.
The need to build this lib, came from the lack of a straightforward and simple library to make http requests from Flyports.
So ok, let’s see what can we do with this library!
while (WFStatus != CONNECTED);
TCP_SOCKET* socket = create_http_socket("google.it");
struct HTTP_HEADER_REQUEST pp;
pp.method = "GET";
pp.resource = "/";
pp.version = "HTTP/1.1";
pp.host = "www.google.it";
pp.parameters_size = 0;
char* request = get_http_request(&pp);
char* response = http_get_response(socket);
The following code makes a GET requesto to http://google.com and returns the response from the server. For a better explanation of the code check the wiki here: http://wiki.openpicus.com/index.php?title=HTTPicus
The implementation of the HTTP is far from being complete, so feel free to join the develop of it and fork on github the repository. All you can do it’s appreciated. To contact Diego, mail him or check him on twitter.