ost::URLStream(3) | Library Functions Manual | ost::URLStream(3) |
ost::URLStream - A URL processing version of TCPStream.
#include <url.h>
Inherits ost::TCPStream.
enum Error { errSuccess = 0, errUnreachable,
errMissing, errDenied, errInvalid, errForbidden,
errUnauthorized, errRelocated, errFailure,
errTimeout, errInterface }
Return error for url fetch. enum Authentication { authAnonymous
= 0, authBasic }
Type of authentication. enum Encoding { encodingBinary = 0,
encodingChunked }
Encoding used in transfer. enum Method { methodHttpGet,
methodHttpPut, methodHttpPost, methodHttpPostMultipart,
methodFtpGet, methodFtpPut, methodFileGet,
methodFilePut }
Type of fetch. enum Protocol { protocolHttp1_0,
protocolHttp1_1 }
http protocol version
URLStream (Family family=IPV4,
timeout_t timer=0)
Construct an instance of URL stream. URLStream & getline
(char *buffer, size_t len)
Line parsing with conversion. Error get (const char *url, size_t
buffer=512)
Get URL data from a named stream of a known buffer size. Error
get (size_t buffer=512)
Get URL data from a named stream of a known buffer size. Error
submit (const char *url, const char **vars, size_t buffer=512)
Submit URL with vars passed as argument array. Error post (const
char *url, const char **vars, size_t buffer=512)
Post URL vars with post method. Error post (const char *url,
MIMEMultipartForm &form, size_t buffer=512)
Post URL with MIME multipart form. Error head (const char *url,
size_t buffer=512)
Used to fetch header information for a resource. void close ()
Close the URL stream for a new connection. void setReferer (const char
*str)
Set the referer url. void setHost (const char *str)
Set the host for the url. void setAddress (const char *str)
Set the address for the url. void setCookie (const char *str)
Set the cookie to pass. void setUser (const char *str)
Set user id for the url. void setPassword (const char *str)
Set password for the url. void setAuthentication (Authentication
a, const char *str=NULL)
Set authentication type for the url. void setProxyUser (const char
*str)
Set proxy user id for the url. void setProxyPassword (const char *str)
Set proxy password for the url. void setProxyAuthentication
(Authentication a, const char *str=NULL)
Set proxy authentication type for the url. void setPragma (const char
*str)
Set the pragmas. void setProxy (const char *host, tpport_t port)
Set the proxy server used. void setAgent (const char *str)
Set the agent. Method getMethod (void)
Get url method (and protocol) employed. void setTimeout
(timeout_t to)
Set socket timeout characteristics for processing URL requests. void
setFollow (bool enable)
Specify url following. void setProtocol (Protocol pro)
Specify http protocol level being used. void setLocalInterface (const
char *intf)
Specify local interface to use.
Error sendHTTPHeader (const char *url, const char
**vars, size_t bufsize)
Send http header to server. int underflow (void)
Called if stream buffer needs refilling. virtual int aRead (char
*buffer, size_t len, timeout_t timer)
Derived method for async or timed I/O function on url stream. virtual int
aWrite (char *buffer, size_t len, timeout_t timer)
Derived method for async or timed I/O function on url stream. virtual void
httpHeader (const char *header, const char *value)
Derived method to receive and parse http 'headers'. virtual char **
extraHeader (void)
A virtual to insert additional header info into the request.
ost::String m_host
ost::String m_address
(Note that these are not member functions.)
__EXPORT char * urlDecode (char *source, char *dest=NULL)
Decode an url parameter (ie '20' -> ' ') __EXPORT char *
urlEncode (const char *source, char *dest, size_t size)
Encode an url parameter (ie ' ' -> '+') __EXPORT char *
b64Decode (char *src, char *dest=NULL)
Decode a string using base64 coding. __EXPORT char * b64Encode
(const char *source, char *dest, size_t size)
Encode a string using base64 coding. __EXPORT size_t b64Encode
(const unsigned char *src, size_t srcsize, char *dst, size_t dstsize)
Encode a octet stream using base64 coding. __EXPORT size_t
b64Decode (const char *src, unsigned char *dst, size_t dstsize)
Decode a string using base64 coding. __EXPORT String
b64Encode (const String &src)
Encode a STL string using base64 coding into a STL string. __EXPORT
String b64Decode (const String &src)
Decode a STL string using base64 coding into an STL String.
__EXPORT String b64Encode (const unsigned char *src,
size_t srcsize)
Encode a octet stream using base64 coding into a STL string. __EXPORT
size_t b64Decode (const String &src, unsigned char *dst,
size_t dstsize)
Decode a string using base64 coding.
A URL processing version of TCPStream.
Author
C++ url processing stream class.
Examples
urlfetch.cpp, and xmlfetch.cpp.
Type of authentication.
Enumerator
Encoding used in transfer.
Enumerator
Return error for url fetch.
Enumerator
Type of fetch.
Enumerator
http protocol version
Enumerator
Construct an instance of URL stream.
Parameters
Derived method for async or timed I/O function on url stream.
Returns
Parameters
Derived method for async or timed I/O function on url stream.
Returns
Parameters
Close the URL stream for a new connection.
A virtual to insert additional header info into the request.
Returns
Get URL data from a named stream of a known buffer size.
Returns
Parameters
Get URL data from a named stream of a known buffer size. Requesting URL defined in previous calls of setAddress() and setHost() functions.
Returns
Parameters
Line parsing with conversion.
Returns
Parameters
Get url method (and protocol) employed.
Returns
Used to fetch header information for a resource.
Returns
Parameters
Derived method to receive and parse http 'headers'.
Parameters
Post URL vars with post method.
Returns
Parameters
Post URL with MIME multipart form.
Returns
Parameters
Send http header to server.
Parameters
Returns
Set the address for the url.
Parameters
Set the agent.
Parameters
Set authentication type for the url.
Parameters
Set the cookie to pass.
Parameters
Specify url following. Set to false to disable following of relocation requests.
Parameters
Set the host for the url.
Parameters
Specify local interface to use.
Parameters
Set password for the url.
Parameters
Set the pragmas.
Parameters
Specify http protocol level being used.
Parameters
Set the proxy server used.
Parameters
Set proxy authentication type for the url.
Parameters
Set proxy password for the url.
Parameters
Set proxy user id for the url.
Parameters
Set the referer url.
Parameters
Set socket timeout characteristics for processing URL requests. Set to 0 for no default timeouts.
Parameters
Set user id for the url.
Parameters
Submit URL with vars passed as argument array. This submit assumes 'GET' method. Use 'post' member to perform post.
Returns
Parameters
Called if stream buffer needs refilling.
Returns
Decode a string using base64 coding. Destination size should be at least strlen(src)+1. Destination will be a string, so is always terminated . This function is deprecated, base64 can use binary source, not only string use overloaded b64Decode.
Returns
Parameters
Decode a string using base64 coding. Destination size should be at least strlen(src)/4*3. Destination are not string terminated (It's just a octet stream).
Returns
Parameters
Decode a STL string using base64 coding into an STL String. Destination size should be at least strlen(src)/4*3. Destination are not string terminated (It's just a octet stream).
Returns
Parameters
Decode a string using base64 coding. Destination size should be at least strlen(src)/4*3. Destination are not string terminated (It's just a octet stream).
Returns
Parameters
Encode a string using base64 coding. Destination size should be at least strlen(src)/4*3+1. Destination is string terminated. This function is deprecated, coded stream can contain terminator character use overloaded b64Encode instead.
Returns
Parameters
Encode a STL string using base64 coding into a STL string.
Returns
Parameters
Encode a octet stream using base64 coding into a STL string.
Returns
Parameters
Encode a octet stream using base64 coding. Destination size should be at least (srcsize+2)/3*4+1. Destination will be a string, so is always terminated (unless you pass dstsize == 0).
Returns
Parameters
Decode an url parameter (ie '\%20' -> ' ')
Parameters
Encode an url parameter (ie ' ' -> '+')
Parameters
Generated automatically by Doxygen for GNU CommonC++ from the source code.
Sun Dec 27 2020 | GNU CommonC++ |