Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

ne_get_response_header(3) [opensolaris man page]

NE_GET_RESPONSE_H(3)						neon API reference					      NE_GET_RESPONSE_H(3)

NAME
ne_get_response_header, ne_response_header_iterate - functions to access response headers SYNOPSIS
#include <ne_request.h> const char *ne_get_response_header (ne_request *request, const char *name); void *ne_response_header_iterate (ne_request *request, void *cursor, const char **name, const char **value); DESCRIPTION
To retrieve the value of a response header field, the ne_get_response_header function can be used, and is given the name of the header to return. To iterate over all the response headers returned, the ne_response_header_iterate function can be used. This function takes a cursor param- eter which should be NULL to retrieve the first header. The function stores the name and value of the next header header in the name and value parameters, and returns a new cursor pointer which can be passed to ne_response_header_iterate to retrieve the next header. RETURN VALUE
ne_get_response_header returns a string, or NULL if no header with that name was given. If used during request processing, the return value pointer is valid only until the next call to ne_begin_request, or else, until the request object is destroyed. Likewise, the cursor, names, and values returned by ne_response_header_iterate are only valid until the next call to ne_begin_request or until the request object is destroyed. EXAMPLES
The following code will output the value of the Last-Modified header for a resource: ne_request *req = ne_request_create(sess, "GET", "/foo.txt"); if (ne_request_dispatch(req) == NE_OK) { const char *mtime = ne_get_response_header(req, "Last-Modified"); if (mtime) { printf("/foo.txt has last-modified value %s ", mtime); } } ne_request_destroy(req); SEE ALSO
ne_request_create(3), ne_request_destroy(3). AUTHOR
Joe Orton <neon@webdav.org>. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +--------------------+-----------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +--------------------+-----------------+ |Availability | SUNWneon | +--------------------+-----------------+ |Interface Stability | Volatile | +--------------------+-----------------+ NOTES
Source for Neon is available on http://opensolaris.org. neon 0.25.5 20 January 2006 NE_GET_RESPONSE_H(3)

Check Out this Related Man Page

NE_REQUEST_CREATE(3)						neon API reference					      NE_REQUEST_CREATE(3)

NAME
ne_request_create, ne_request_dispatch, ne_request_destroy - low-level HTTP request handling SYNOPSIS
#include <ne_request.h> ne_request *ne_request_create (ne_session *session, const char *method, const char *path); int ne_request_dispatch (ne_request *req); void ne_request_destroy (ne_request *req); DESCRIPTION
An HTTP request, represented by the ne_request type, specifies that some operation is to be performed on some resource. The ne_request_cre- ate function creates a request object, specifying the operation in the method parameter. The location of the resource is determined by the server in use for the session given by the sess parameter, combined with the path parameter. The path string used must conform to the abs_path definition given in RFC2396, with an optional "?query" part, and must be URI-escaped by the caller (for instance, using ne_path_escape). If the string comes from an untrusted source, failure to perform URI-escaping results in a security vulnerability. To dispatch a request, and process the response, the ne_request_dispatch function can be used. An alternative is to use the (more complex, but more flexible) combination of the ne_begin_request, ne_end_request, and ne_read_response_block functions; see ne_begin_request. To add extra headers in the request, the functions ne_add_request_header(3) and ne_print_request_header(3) can be used. To include a mes- sage body with the request, one of the functions ne_set_request_body_buffer, ne_set_request_body_fd(3), or ne_set_request_body_provider can be used. The return value of ne_request_dispatch indicates merely whether the request was sent and the response read successfully. To discover the result of the operation, ne_get_status(3), along with any processing of the response headers and message body. A request can only be dispatched once: calling ne_request_dispatch more than once on a single ne_request object produces undefined behav- iour. Once all processing associated with the request object is complete, use the ne_request_destroy function to destroy the resources as- sociated with it. Any subsequent use of the request object produces undefined behaviour. RETURN VALUE
The ne_request_create function returns a pointer to a request object (and never NULL). The ne_request_dispatch function returns zero if the request was dispatched successfully, and a non-zero error code otherwise. ERRORS
NE_ERROR Request failed (see session error string) NE_LOOKUP The DNS lookup for the server (or proxy server) failed. NE_AUTH Authentication failed on the server. NE_PROXYAUTH Authentication failed on the proxy server. NE_CONNECT A connection to the server could not be established. NE_TIMEOUT A timeout occurred while waiting for the server to respond. EXAMPLE
An example of applying a MKCOL operation to the resource at the locationhttp://www.example.com/foo/bar/: ne_session *sess = ne_session_create("http", "www.example.com", 80); ne_request *req = ne_request_create(sess, "MKCOL", "/foo/bar/"); if (ne_request_dispatch(req)) { printf("Request failed: %s ", ne_get_error(sess)); } ne_request_destroy(req); SEE ALSO
ne_get_error(3), ne_set_error(3), ne_get_status(3), ne_add_request_header(3), ne_set_request_body_buffer(3). AUTHOR
Joe Orton <neon@webdav.org>. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +--------------------+-----------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +--------------------+-----------------+ |Availability | SUNWneon | +--------------------+-----------------+ |Interface Stability | Volatile | +--------------------+-----------------+ NOTES
Source for Neon is available on http://opensolaris.org. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +--------------------+-----------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +--------------------+-----------------+ |Availability | SUNWneon | +--------------------+-----------------+ |Interface Stability | Volatile | +--------------------+-----------------+ NOTES
Source for Neon is available on http://opensolaris.org. neon 0.25.5 20 January 2006 NE_REQUEST_CREATE(3)
Man Page