Join Now
Quality Rating:
  • Currently 0.0 / 5
(0.0 / 5 - 0 votes cast)
Expertise Level:
  • Currently 0.0 / 5
(0.0 / 5 - 0 votes cast)

This page was last modified 05:27, 25 October 2007.

Connecting to http using ghttp lib

From Forum Nokia Wiki

The gHTTP library is designed to be simple and easy to use while still allowing you to get your feet wet at the protocol layer if you have to. You should be able to use the library in your application and never block waiting to send or receive data to/from a remote server

Example

A simple example

/* This is the http request object */
ghttp_request *request = NULL;
 
/* Allocate a new empty request object */
request = ghttp_request_new();
 
/* Set the URI for the request object */
ghttp_set_uri(request, "http://localhost:8080/index.html");
 
/* Close the connection after you are done. */
ghttp_set_header(request, http_hdr_Connection, "close");
 
/* Prepare the connection */
ghttp_prepare(request);
 
/* Process the request */
ghttp_process(request);
 
/* Write out the body. 
Note that the body of the request may not be null terminated
so we have to be careful of the length. */
fwrite(ghttp_get_body(request), ghttp_get_body_len(request), 1, stdout);
 
/* Destroy the request. 
This closes any file descriptors that may be open and 
will free any memory associated with the request. */
ghttp_request_destroy(request);
Related Discussions
Thread Thread Starter Forum Replies Last Post
ListBox and MEikListBoxObserver Ikhtys General Symbian C++ 2 2007-12-04 06:13
Displaying status while connecting to a HTTP URL vishaljumani Mobile Java General 9 2003-09-05 11:52
what is ordinal 1 xhsoldier General Symbian C++ 5 2007-05-08 11:09
Ipaq 5450, Nokia 6310i GPRS Problem ABartlam Bluetooth Technology 3 2003-05-02 06:21
Request | SDKs >> Alternative download site series60nubee Symbian Tools & SDKs 19 2006-11-30 21:39
 
Powered by MediaWiki