Opened 10 years ago

Closed 10 years ago

Last modified 9 years ago

#1018 closed enhancement (fixed)

Simple HTTP client implementation (thanks Johan Lantz for the suggestion)

Reported by: bennylp Owned by: bennylp
Priority: normal Milestone: release-1.6
Component: pjlib-util Version: trunk
Keywords: Cc:
Backport to 1.x milestone: Backported:

Description (last modified by bennylp)

A simple HTTP client implementation will make way for XCAP client implementation.

Specifications

Assorted specifications:

  • Supported HTTP method(s):
    • GET
    • PUT
    • DELETE
  • Asynchronous:
    • application create/build the HTTP request
    • the request is submitted
    • application will be notified when the request is complete and complete response has been received.
  • Application may cancel the request once it has been submitted
  • Options:
    • request timeout support
    • ability to add custom headers
    • HTTPS (optional)

Change History (12)

comment:1 Changed 10 years ago by bennylp

  • Description modified (diff)

comment:2 Changed 10 years ago by bennylp

  • Description modified (diff)

comment:3 Changed 10 years ago by bennylp

  • Description modified (diff)

comment:4 Changed 10 years ago by bennylp

  • Description modified (diff)

comment:5 Changed 10 years ago by ming

Implemented in r3087

  • pjlib-util:
    • implement http_client
  • pjlib-util-test:
    • unit test for http_client
  • pjsip-apps/samples:
    • sample http client implementation
  • build:
    • added http_client support on VS6, VS2005, MMP, and Makefile

comment:6 Changed 10 years ago by ming

In r3089:

  • httpdemo: make the 2nd parameter (output filename) optional (result will be printed to stdout if output file is not provided.
  • remove trailing "\n" from PJ_LOG.
  • change response.status_code from pj_str_t to pj_uint16_t.
  • remove PJ_EPENDING status checking from on_complete.

comment:7 Changed 10 years ago by bennylp

In r3092:

  • fixed gcc warning about incompatible pointer types

comment:8 Changed 10 years ago by bennylp

In r3095:

  • fixed some more warnings about pointer conversions, or errors if the library is compiled in C++ mode (thanks Atik Khan for the report)

comment:9 Changed 10 years ago by ming

In r3098:

  • Immediately process response body after receiving the header.
  • Fix GET method when Content-Length header is not specified.
  • Fix checking when HTTP request is cancelled.

comment:10 Changed 10 years ago by bennylp

  • Resolution set to fixed
  • Status changed from new to closed

comment:11 Changed 10 years ago by bennylp

In r3147:

  • fixed failure in pjlib-util-test due to the use of hardcoded port in HTTP client test

comment:12 Changed 9 years ago by ming

In r3227:
Application may now destroy pj_http_req inside on_complete callback.

Note: See TracTickets for help on using tickets.