Unit internetaccess
Description
You can use this unit to configure and create internet connections.
Currently it only supports HTTP/S connections, but this might change in future (e.g. to also support ftp)
Overview
Classes, Interfaces, Objects and Records
Functions and Procedures
Types
PInternetConfig=ˆTInternetConfig; |
TDecodedUrlParts = set of (dupProtocol, dupUsername, dupPassword, dupHost, dupPort, dupPath, dupParams, dupLinkTarget); |
TInternetAccessDataBlock = TPCharView; |
PMIMEMultipartSubData = ˆTMIMEMultipartSubData; |
THeaderKind = (...); |
TCookieFlags = set of (cfHostOnly, cfSecure ); |
TInternetAccessReaction = (...); |
THeaderEnumCallback = procedure (data: pointer; headerKindHint: THeaderKind; const name, value: string); |
TProgressEvent = procedure (sender: TObject; progress,maxprogress: longint) of object; |
TTransferClearEvent = procedure() of object; |
TTransferBlockWriteEvent = TStreamLikeWriteNativeInt; |
TTransferStartEvent = procedure (sender: TObject; const method: string; const url: TDecodedUrl; const data: TInternetAccessDataBlock) of object; |
TTransferReactEvent = procedure (sender: TInternetAccess; var transfer: TTransfer; var reaction: TInternetAccessReaction) of object; |
TTransferEndEvent = procedure (sender: TObject; var transfer: TTransfer) of object; |
TTransferInflaterClass = class of TTransferContentInflater; |
TUrlEncodingModel = (...); |
TInternetAccessClass=class of TInternetAccess; |
TRetrieveType = (...); |
Constants
Variables
Description
Functions and Procedures
function decodeURL(const totalURL: string; normalize: boolean = true): TDecodedUrl; |
Splits a url into parts
Parameters
- normalize
- performs some normalizations (e.g. foo//bar -> foo/bar)
|
function decodeURL(const protocol, host, url: string; normalize: boolean = true): TDecodedUrl; |
|
function httpRequest(url: string): string; overload; |
Make a HTTP GET request to a certain url.
|
function httpRequest(url: string; rawpostdata: string): string; overload; |
Make a HTTP POST request to a certain url, sending the data in rawpostdata unmodified to the server.
|
function httpRequest(url: string; postdata: TStringList): string; overload; |
Make a HTTP POST request to a certain url, sending the data in postdata to the server, after url encoding all name=value pairs of it.
|
function httpRequest(const method, url, rawdata: string): string; overload; |
Make a HTTP request to a certain url, sending the data in rawdata unmodified to the server.
|
function defaultInternet: TInternetAccess; |
This provides a thread-safe default internet
|
procedure freeThreadVars; |
If you use the procedural interface from different threads, you have to call freeThreadVars before the thread terminates to prevent memory leaks
|
Types
TDecodedUrlParts = set of (dupProtocol, dupUsername, dupPassword, dupHost, dupPort, dupPath, dupParams, dupLinkTarget); |
|
THeaderKind = (...); |
Values
-
iahUnknown
-
iahContentType
-
iahContentDisposition
-
iahAccept
-
iahReferer
-
iahLocation
-
iahSetCookie
-
iahCookie
-
iahUserAgent
|
TCookieFlags = set of (cfHostOnly, cfSecure ); |
|
TInternetAccessReaction = (...); |
Values
-
iarAccept
-
iarFollowRedirectGET
-
iarFollowRedirectKeepMethod
-
iarRetry
-
iarReject
|
THeaderEnumCallback = procedure (data: pointer; headerKindHint: THeaderKind; const name, value: string); |
|
TProgressEvent = procedure (sender: TObject; progress,maxprogress: longint) of object; |
Event to monitor the progress of a download (measured in bytes)
|
TTransferClearEvent = procedure() of object; |
Event to intercept transfers end/start
|
TTransferEndEvent = procedure (sender: TObject; var transfer: TTransfer) of object; |
|
TUrlEncodingModel = (...); |
URL Encoding encodes every special character #$AB by %AB . This model describes which characters are special:
Values
-
ueHTMLForm: Encode for application/x-www-form-urlencoded as defined in HTML 5 standard
-
ueHTMLMultipartFieldName: Encode for multipart/form-data field names as defined in HTML 5 standard
-
ueURLPath: Encode for the path part of an URL
-
ueURLQuery: Encode for the query part of an URL
-
ueXPathURI: Encode for the XPath/XQuery function fn:encode-for-uri as defined in the XPath standard
-
ueXPathHTML4: Encode for the XPath/XQuery function fn:escape-html-uri as defined in the XPath standard (they quote the the HTML4 standard)
-
ueXPathFromIRI: Encode for the XPath/XQuery function fn:iri-to-uri as defined in the XPath standard
|
TRetrieveType = (...); |
Values
-
rtEmpty
-
rtRemoteURL
-
rtFile
-
rtXML
-
rtJSON
|
Constants
DecodedUrlPartsALL = [dupProtocol, dupUsername, dupPassword, dupHost, dupPort, dupPath, dupParams, dupLinkTarget]; |
|
ContentTypeUrlEncoded: string = 'application/x-www-form-urlencoded'; |
|
ContentTypeMultipart: string = 'multipart/form-data'; |
|
ContentTypeTextPlain: string = 'text/plain'; |
|
Variables
defaultInternetConfiguration: TInternetConfig; |
default configuration, used by all internet access classes
|
defaultInternetAccessClass:TInternetAccessClass = nil; |
default internet access. This controls which internet library the program will use.
|
Generated by PasDoc 0.16.0.