Go to the documentation of this file.
47 #ifndef CCXX_CONFIG_H_
51 #ifndef CCXX_SOCKET_H_
59 #ifdef CCXX_NAMESPACES
128 const char *agent, *referer, *cookie, *pragma, *user, *password;
129 const char *proxyUser, *proxyPasswd;
140 Authentication proxyAuth;
146 Error getHTTPHeaders();
195 virtual void httpHeader(
const char *header,
const char *value);
250 Error submit(
const char *url,
const char **vars,
size_t buffer = 512);
260 Error post(
const char *url,
const char **vars,
size_t buffer = 512);
355 {proxyPasswd = str;};
483 char *dst,
size_t dstsize);
495 unsigned char *dst,
size_t dstsize);
531 unsigned char *dst,
size_t dstsize);
534 #ifdef CCXX_NAMESPACES
unsigned short tpport_t
Transport Protocol Ports.
Definition: address.h:86
@ methodHttpPostMultipart
Definition: url.h:112
void setPragma(const char *str)
Set the pragmas.
Definition: url.h:370
__EXPORT size_t b64Encode(const unsigned char *src, size_t srcsize, char *dst, size_t dstsize)
void setAddress(const char *str)
Set the address for the url.
Definition: url.h:306
int underflow(void)
Called if stream buffer needs refilling.
This object is used to hold the actual and valid internet address of a specific host machine that wil...
Definition: address.h:562
void setAuthentication(Authentication a, const char *str=NULL)
Set authentication type for the url.
__EXPORT char * b64Encode(const char *source, char *dest, size_t size)
void setCookie(const char *str)
Set the cookie to pass.
Definition: url.h:314
Method
Type of fetch.
Definition: url.h:108
unsigned long timeout_t
Definition: thread.h:74
Authentication
Type of authentication.
Definition: url.h:92
@ methodFileGet
Definition: url.h:115
This object is used to hold the actual and valid internet address of a specific host machine that wil...
Definition: address.h:949
virtual void httpHeader(const char *header, const char *value)
Derived method to receive and parse http "headers".
@ errRelocated
Definition: url.h:83
@ errMissing
Definition: url.h:78
Family
Definition: socket.h:122
@ errUnauthorized
Definition: url.h:82
void setProxyPassword(const char *str)
Set proxy password for the url.
Definition: url.h:354
void close()
Close the URL stream for a new connection.
__EXPORT size_t b64Decode(const char *src, unsigned char *dst, size_t dstsize)
Error get(size_t buffer=512)
Get URL data from a named stream of a known buffer size.
__EXPORT String b64Encode(const unsigned char *src, size_t srcsize)
void setPassword(const char *str)
Set password for the url.
Definition: url.h:330
Error
Definition: socket.h:131
__EXPORT String b64Decode(const String &src)
@ methodFtpGet
Definition: url.h:113
void setUser(const char *str)
Set user id for the url.
Definition: url.h:322
virtual char ** extraHeader(void)
A virtual to insert additional header info into the request.
@ errInvalid
Definition: url.h:80
TCP streams are used to represent TCP client connections to a server by TCP protocol servers for acce...
Definition: socket.h:1632
ost::String m_host
Definition: url.h:150
#define __EXPORT
Definition: config.h:979
__EXPORT char * urlEncode(const char *source, char *dest, size_t size)
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.
@ errDenied
Definition: url.h:79
Protocol
http protocol version
Definition: url.h:122
__EXPORT size_t b64Decode(const String &src, unsigned char *dst, size_t dstsize)
@ protocolHttp1_0
Definition: url.h:123
Error head(const char *url, size_t buffer=512)
Used to fetch header information for a resource.
Error post(const char *url, const char **vars, size_t buffer=512)
Post URL vars with post method.
Method getMethod(void)
Get url method (and protocol) employed.
Definition: url.h:394
@ methodFtpPut
Definition: url.h:114
__EXPORT char * b64Decode(char *src, char *dest=NULL)
void setTimeout(timeout_t to)
Set socket timeout characteristics for processing URL requests.
Definition: url.h:403
virtual int aWrite(char *buffer, size_t len, timeout_t timer)
Derived method for async or timed I/O function on url stream.
@ methodHttpPut
Definition: url.h:110
@ errForbidden
Definition: url.h:81
@ errTimeout
Definition: url.h:85
void setAgent(const char *str)
Set the agent.
Definition: url.h:386
Error submit(const char *url, const char **vars, size_t buffer=512)
Submit URL with vars passed as argument array.
virtual int aRead(char *buffer, size_t len, timeout_t timer)
Derived method for async or timed I/O function on url stream.
Error sendHTTPHeader(const char *url, const char **vars, size_t bufsize)
Send http header to server.
@ errUnreachable
Definition: url.h:77
__EXPORT String b64Encode(const String &src)
void setReferer(const char *str)
Set the referer url.
void setLocalInterface(const char *intf)
Specify local interface to use.
Definition: url.h:427
Network addresses and sockets related classes.
void setHost(const char *str)
Set the host for the url.
Definition: url.h:298
MIME document abstractions.
@ methodHttpPost
Definition: url.h:111
@ methodHttpGet
Definition: url.h:109
Error get(const char *url, size_t buffer=512)
Get URL data from a named stream of a known buffer size.
void setFollow(bool enable)
Specify url following.
Definition: url.h:412
A URL processing version of TCPStream.
Definition: url.h:70
This is a generic and portable string class.
Definition: string.h:81
__EXPORT char * urlDecode(char *source, char *dest=NULL)
void setProxy(const char *host, tpport_t port)
Set the proxy server used.
void setProxyUser(const char *str)
Set proxy user id for the url.
Definition: url.h:346
@ errFailure
Definition: url.h:84
Error post(const char *url, MIMEMultipartForm &form, size_t buffer=512)
Post URL with MIME multipart form.
void setProtocol(Protocol pro)
Specify http protocol level being used.
Definition: url.h:420
void setProxyAuthentication(Authentication a, const char *str=NULL)
Set proxy authentication type for the url.