logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

ne_get_status, ne_get_response_location - retrieve HTTP response properties

Description

       The ne_get_status function returns a pointer to the HTTP status object giving the result of a request.
       The object returned only becomes valid once the request has been successfully dispatched (the return
       value of ne_request_dispatch or ne_begin_request was zero).

       If the response includes a Location header, the ne_get_response_location function parses and resolves the
       URI-reference relative to the request target. If a fragment ("#fragment") is applicable to the request
       target, it can be passed as an argument to allow appropriate relative resolution.

Examples

       Display the response status code of applying the HEAD method to some resource.

           ne_request *req = ne_request_create(sess, "HEAD", "/foo/bar");
           if (ne_request_dispatch(req))
              /* handle errors... */
           else
              printf("Response status code was %d\n", ne_get_status(req)->code);
           ne_request_destroy(req);

History

ne_get_response_location is available in neon 0.34.0 and later.

Name

       ne_get_status, ne_get_response_location - retrieve HTTP response properties

Return Value

ne_get_status returns a pointer to the HTTP status object giving the result of a request. This pointer is
       valid until the associated request object is destroyed.

       ne_get_response_location returns a malloc-allocated ne_uri object, or NULL if either the URI in the
       Location header could not be parsed or the Location header was not present.

See Also

       ne_status, ne_request_create

Synopsis

#include<ne_request.h>constne_status*ne_get_status(constne_request*request);ne_uri*ne_get_response_location(ne_request*request);

See Also