Namespace: Consultingwerk
Class 
HttpClient Copy to Clipboard
Parent classes:
Inherits: Progress.Lang.Object
Implements: Consultingwerk.ISocketReadHandler

File:HttpClient
Purpose:Provides HTML GET and POST functionality using Socket
communication
Author(s):Mike Fechner / Consultingwerk Ltd.
Created:Wed Jan 02 23:23:18 CET 2013
Notes:The HttpClient write debugging messages to the AppServer
or Client Logfile using the "HttpClient" custom entry type



Top Method Summary
Options Name Purpose
+ LONGCHAR GetLongchar (character, character) Performs a GET http request
+ LONGCHAR GetLongchar (character, character, character) Performs a GET http request
+ LONGCHAR GetLongchar (character, integer, character) Performs a GET http request
+ LONGCHAR GetLongchar (character, integer, character, character) Performs a GET http request
+ LONGCHAR PostLongchar (character, character, character, longchar) Performs a POST http request using default port settings
+ LONGCHAR PostLongChar (character, integer, character, character, character, longchar) Performs a POST http request
+ LONGCHAR PostLongchar (character, integer, character, character, longchar) Performs a POST http request
# ProcessResponseChunks (longchar) Processes the payload of a Chunked Transfer Encoding response
# CHARACTER ProcessResponseHeaders (longchar) Processes the Reponse Headers into the ReponseHeaderDictionary
+ ReadResponseHandler () Data is available on a socket or the remote end of a connection has closed its socket; applies only to socket objects.
+ SetBasicAuthorization (character, character) Adds a basic authorization header to the request
# SetNumericHttpResultCode () Sets the numeric HttpResultCode property based on the HttpResult property
- WaitForReadResponse (handle) Performs the WAIT-FOR READ-RESPONSE of the Socket handle

Top Constructor Summary
Options Name Purpose
+ HttpClient () Constructor for the HttpClient class

Top Property Summary
Options Name Purpose
+ CHARACTER HttpResult Returns the HttpResult code of the last request
+ INTEGER HttpResultCode Returns the HttpResult code of the last request
+ Consultingwerk.Framework.Collections.CharacterDictionary RequestHeaders Returns a reference to the Dictionary of Request headers
+ Consultingwerk.ListNameValuePair ResponseHeaders Returns a reference to the Dictionary of Response headers


Method Detail
Top

PUBLIC LONGCHAR GetLongchar (character, character)

Purpose: Performs a GET http request
Notes:

Parameters:
pcHostName CHARACTER
The hostname to request the resource form
pcUrl CHARACTER
The URL to request
Returns LONGCHAR
The LONGCHAR response
Top

PUBLIC LONGCHAR GetLongchar (character, character, character)

Purpose: Performs a GET http request
Notes:

Parameters:
pcHostName CHARACTER
The hostname to request the resource form
pcUrl CHARACTER
The URL to request
pcHttpVersion CHARACTER
The http version to support (HTTP/1.0, HTTP/1.1)
Returns LONGCHAR
The LONGCHAR response
Top

PUBLIC LONGCHAR GetLongchar (character, integer, character)

Purpose: Performs a GET http request
Notes:

Parameters:
pcHostName CHARACTER
The hostname to request the resource form
piPort INTEGER
The portnumber to request from
pcUrl CHARACTER
The URL to request
Returns LONGCHAR
The LONGCHAR response
Top

PUBLIC LONGCHAR GetLongchar (character, integer, character, character)

Purpose: Performs a GET http request
Notes:

Parameters:
pcHostName CHARACTER
The hostname to request the resource form
piPort INTEGER
The portnumber to request from
pcUrl CHARACTER
The URL to request
pcHttpVersion CHARACTER
The http version to support (HTTP/1.0, HTTP/1.1)
Returns LONGCHAR
The LONGCHAR response
Top

PUBLIC LONGCHAR PostLongchar (character, character, character, longchar)

Purpose: Performs a POST http request using default port settings
Notes:

Parameters:
pcHostName CHARACTER
The hostname to request the resource form
pcUrl CHARACTER
The URL to request
pcContentType CHARACTER
The content-type, defaults to application/json
plcPostData LONGCHAR
The LONGCHAR data to be posted
Returns LONGCHAR
The LONGCHAR response
Top

PUBLIC LONGCHAR PostLongChar (character, integer, character, character, character, longchar)

Purpose: Performs a POST http request
Notes:

Parameters:
pcHostName CHARACTER
The hostname to request the resource form
piPort INTEGER
The portnumber to request from
pcUrl CHARACTER
The URL to request
pcHttpVersion CHARACTER
The http version to support (HTTP/1.0, HTTP/1.1)
pcContentType CHARACTER
The content-type, defaults to application/json
plcPostData LONGCHAR
The LONGCHAR data to be posted
Returns LONGCHAR
The LONGCHAR response
Top

PUBLIC LONGCHAR PostLongchar (character, integer, character, character, longchar)

Purpose: Performs a POST http request
Notes:

Parameters:
pcHostName CHARACTER
The hostname to request the resource form
piPort INTEGER
The portnumber to request from
pcUrl CHARACTER
The URL to request
pcContentType CHARACTER
The content-type, defaults to application/json
plcPostData LONGCHAR
The LONGCHAR data to be posted
Returns LONGCHAR
The LONGCHAR response
Top

PROTECTED ProcessResponseChunks (longchar)

Purpose: Processes the payload of a Chunked Transfer Encoding response
Notes:

Parameters:
plcResponse LONGCHAR
INPUT-OUTPUT The response data where the chunks should be processed
Top

PROTECTED CHARACTER ProcessResponseHeaders (longchar)

Purpose: Processes the Reponse Headers into the ReponseHeaderDictionary
Notes:

Parameters:
plcResponse LONGCHAR
INPUT-OUTPUT Receives the complete http response and returns it without the headers
Returns CHARACTER
The HTTP status code
Top

PUBLIC ReadResponseHandler ()

Purpose: Data is available on a socket or the remote end of a connection has
closed its socket; applies only to socket objects.
Notes: Invoked from the Socket READ-RESPONSE-PROCEDURE
The AVM invokes this procedure whenever it detects that data is
available on the socket or that the remote end of the socket has
closed its end of the socket. In this procedure, the SELF handle
identifies the affected socket object.

Top

PUBLIC SetBasicAuthorization (character, character)

Purpose: Adds a basic authorization header to the request
Notes:

Parameters:
pcUserName CHARACTER
The UserName to use for basic authorization
pcPassword CHARACTER
The password to use for basic authorization
Top

PROTECTED SetNumericHttpResultCode ()

Purpose: Sets the numeric HttpResultCode property based on the HttpResult
property
Notes:

Top

PRIVATE WaitForReadResponse (handle)

Purpose: Performs the WAIT-FOR READ-RESPONSE of the Socket handle
Notes: Seperate method, to avoid need for compilation with -IOEverywhere 1
On 10.2B execution will required -IOEverywhere 1

Parameters:
phSocket HANDLE
The handle of the socket


Constructor Detail
Top

PUBLIC HttpClient ()

Purpose: Constructor for the HttpClient class
Notes:



Property Detail
Top

PUBLIC CHARACTER HttpResult

Purpose: Returns the HttpResult code of the last request
Notes: e.g. HTTP/1.1 200 OK

Returns CHARACTER
Top

PUBLIC INTEGER HttpResultCode

Purpose: Returns the HttpResult code of the last request
Notes: e.g. 200

Returns INTEGER
Top

PUBLIC Consultingwerk.Framework.Collections.CharacterDictionary RequestHeaders

Purpose: Returns a reference to the Dictionary of Request headers
Notes:

Returns Consultingwerk.Framework.Collections.CharacterDictionary
Top

PUBLIC Consultingwerk.ListNameValuePair ResponseHeaders

Purpose: Returns a reference to the Dictionary of Response headers
Notes:

Returns Consultingwerk.ListNameValuePair


©2006-2016 Consultingwerk Ltd.         info@consultingwerk.de         http://www.consultingwerk.de       26.08.2016 08:29:17