ajhttp.c
Returns a proxy definition (if any). Any proxy string given as an
argument overrides any EMBOSS_PROXY definition. This
allows strings from DB definitions to override such an envvar.
Synopsis
Prototype
AjBool ajHttpGetProxyinfo (
const AjPStr dbproxy,
ajint* proxyport,
AjPStr* proxyname,
AjPStr* proxyauth,
AjPStr* proxycreds
);
Type | Name | Read/Write | Description |
const AjPStr | dbproxy | Input | Primary proxy string (if any) |
ajint* | proxyport | Output | Proxy port |
AjPStr* | proxyname | Output | Proxy name |
AjPStr* | proxyauth | Output | Proxy authentication type (if any) |
AjPStr* | proxycreds | Output | Proxy auth credentials (if any) |
AjBool | | RETURN | ajTrue if a proxy was defined |
Input
dbproxy: | (Input) | Primary proxy string (if any) |
Output
proxyport: | (Output) | Proxy port |
proxyname: | (Output) | Proxy name |
proxyauth: | (Output) | Proxy authentication type (if any) |
proxycreds: | (Output) | Proxy auth credentials (if any) |
Returns
AjBool: | ajTrue if a proxy was defined |
Description
Returns a proxy definition (if any). Any proxy string given as an
argument overrides any EMBOSS_PROXY definition. This
allows strings from DB definitions to override such an envvar.
See Also
See other functions in this section
Availability
In release 6.4.0
Returns the HTTP version. Any supplied version takes precedence over
an EMBOSS_HTTPVERSION definition so allowing DB entries to
override such a setting.
Synopsis
Prototype
AjBool ajHttpGetVersion (
const AjPStr version,
AjPStr* httpver
);
Type | Name | Read/Write | Description |
const AjPStr | version | Input | Version or NULL (or zero-length string) |
AjPStr* | httpver | Output | HTTP version |
AjBool | | RETURN | ajTrue if a version was defined |
Input
version: | (Input) | Version or NULL (or zero-length string) |
Output
httpver: | (Output) | HTTP version |
Returns
AjBool: | ajTrue if a version was defined |
Description
Returns the HTTP version. Any supplied version takes precedence over
an EMBOSS_HTTPVERSION definition so allowing DB entries to
override such a setting.
See Also
See other functions in this section
Availability
In release 6.4.0
Opens an HTTP connection
Synopsis
Prototype
FILE* ajHttpOpen (
const AjPStr dbname,
const AjPStr host,
ajint iport,
const AjPStr get,
struct AJSOCKET* Psock
);
Type | Name | Read/Write | Description |
const AjPStr | dbname | Input | Database name (for error reporting) |
const AjPStr | host | Input | Host name |
ajint | iport | Input | Port |
const AjPStr | get | Input | GET string |
struct AJSOCKET* | Psock | Modify | Socket returned to caller |
FILE* | | RETURN | Open file on success, NULL on failure |
Input
dbname: | (Input) | Database name (for error reporting) |
host: | (Input) | Host name |
iport: | (Input) | Port |
get: | (Input) | GET string |
Input & Output
Psock: | (Modify) | Socket returned to caller |
Returns
FILE*: | Open file on success, NULL on failure |
Description
Opens an HTTP connection
See Also
See other functions in this section
Availability
In release 6.4.0
Opens an HTTP connection via a proxy
Synopsis
Prototype
FILE* ajHttpOpenProxy (
const AjPStr dbname,
const AjPStr proxyname,
ajint proxyport,
const AjPStr proxyauth,
const AjPStr proxycreds,
const AjPStr host,
ajint iport,
const AjPStr get,
struct AJSOCKET* Psock
);
Type | Name | Read/Write | Description |
const AjPStr | dbname | Input | Databse name (for error reporting) |
const AjPStr | proxyname | Input | Proxy name |
ajint | proxyport | Input | Proxy port |
const AjPStr | proxyauth | Input | Proxy auth type (if any) |
const AjPStr | proxycreds | Input | Proxy auth credentials (if any) |
const AjPStr | host | Input | Host name |
ajint | iport | Input | Port |
const AjPStr | get | Input | GET string |
struct AJSOCKET* | Psock | Modify | Socket returned to caller |
FILE* | | RETURN | Open file on success, NULL on failure |
Input
dbname: | (Input) | Databse name (for error reporting) |
proxyname: | (Input) | Proxy name |
proxyport: | (Input) | Proxy port |
proxyauth: | (Input) | Proxy auth type (if any) |
proxycreds: | (Input) | Proxy auth credentials (if any) |
host: | (Input) | Host name |
iport: | (Input) | Port |
get: | (Input) | GET string |
Input & Output
Psock: | (Modify) | Socket returned to caller |
Returns
FILE*: | Open file on success, NULL on failure |
Description
Opens an HTTP connection via a proxy
See Also
See other functions in this section
Availability
In release 6.4.0
Initialise a URL components object
Synopsis
Prototype
AjPUrlref ajHttpUrlrefNew (
void
);
Type | Name | Read/Write | Description |
AjPUrlref | | RETURN | URL Components |
Returns
Description
Initialise a URL components object
See Also
See other functions in this section
Availability
In release 6.4.0
Delete URL components object
Synopsis
Prototype
void ajHttpUrlrefDel (
AjPUrlref* thys
);
Type | Name | Read/Write | Description |
AjPUrlref* | thys | Modify | URL components object |
void | | RETURN | |
Input & Output
thys: | (Modify) | URL components object |
Returns
Description
Delete URL components object
See Also
See other functions in this section
Availability
In release 6.4.0
Parse an IPV4/6 URL into its components
Synopsis
Prototype
void ajHttpUrlrefParseC (
AjPUrlref* parts,
const char* url
);
Type | Name | Read/Write | Description |
AjPUrlref* | parts | Modify | URL components object |
const char* | url | Modify | URL |
void | | RETURN | |
Input & Output
parts: | (Modify) | URL components object |
url: | (Modify) | URL |
Returns
Description
Parse an IPV4/6 URL into its components
See Also
See other functions in this section
Availability
In release 6.4.0
Separate any port from a host specification (IPV4/6)
Synopsis
Prototype
void ajHttpUrlrefSplitPort (
AjPUrlref urli
);
Type | Name | Read/Write | Description |
AjPUrlref | urli | Modify | URL components object |
void | | RETURN | |
Input & Output
urli: | (Modify) | URL components object |
Returns
Description
Separate any port from a host specification (IPV4/6)
See Also
See other functions in this section
Availability
In release 6.4.0
Separate any username[:password] from a host specification (IPV4/6)
Synopsis
Prototype
void ajHttpUrlrefSplitUsername (
AjPUrlref urli
);
Type | Name | Read/Write | Description |
AjPUrlref | urli | Modify | URL components object |
void | | RETURN | |
Input & Output
urli: | (Modify) | URL components object |
Returns
Description
Separate any username[:password] from a host specification (IPV4/6)
See Also
See other functions in this section
Availability
In release 6.4.0
Returns the components of a URL (IPV4/6)
An equivalent for seqHttpUrl().
Synopsis
Prototype
AjBool ajHttpQueryUrl (
const AjPQuery qry,
ajint* iport,
AjPStr* host,
AjPStr* urlget
);
Type | Name | Read/Write | Description |
const AjPQuery | qry | Input | Database query |
ajint* | iport | Output | Port |
AjPStr* | host | Output | Host name |
AjPStr* | urlget | Output | URL for the HTTP header GET |
AjBool | | RETURN | ajTrue if the URL was parsed |
Input
qry: | (Input) | Database query |
Output
iport: | (Output) | Port |
host: | (Output) | Host name |
urlget: | (Output) | URL for the HTTP header GET |
Returns
AjBool: | ajTrue if the URL was parsed |
Description
Returns the components of a URL (IPV4/6)
An equivalent for seqHttpUrl().
See Also
See other functions in this section
Availability
In release 6.4.0
Deconstruct a URL (IPV4/6)
Synopsis
Prototype
void ajHttpUrlDeconstruct (
const AjPStr url,
ajint* iport,
AjPStr* host,
AjPStr* urlget
);
Type | Name | Read/Write | Description |
const AjPStr | url | Input | url |
ajint* | iport | Output | Port |
AjPStr* | host | Output | Host name |
AjPStr* | urlget | Output | URL for the HTTP header GET |
void | | RETURN | |
Input
Output
iport: | (Output) | Port |
host: | (Output) | Host name |
urlget: | (Output) | URL for the HTTP header GET |
Returns
Description
Deconstruct a URL (IPV4/6)
See Also
See other functions in this section
Availability
In release 6.4.0
Reads the header of http response in given buffer buff,
if it includes a redirection response updates the host, port and get
parameters using the 'Location' header
Synopsis
Prototype
AjBool ajHttpRedirect (
AjPFilebuff buff,
AjPStr* host,
ajint* port,
AjPStr* path
);
Type | Name | Read/Write | Description |
AjPFilebuff | buff | Modify | file buffer |
AjPStr* | host | Output | Host name |
ajint* | port | Output | Port |
AjPStr* | path | Output | part of URL after port number |
AjBool | | RETURN | returns true if the header includes a redirection response |
Output
host: | (Output) | Host name |
port: | (Output) | Port |
path: | (Output) | part of URL after port number |
Input & Output
Returns
AjBool: | returns true if the header includes a redirection response |
Description
Reads the header of http response in given buffer buff,
if it includes a redirection response updates the host, port and get
parameters using the 'Location' header
See Also
See other functions in this section
Availability
In release 6.4.0
Reads the header of http response in given buffer buff,
if it includes a redirection response updates the host, port and get
parameters using the 'Location' header
Synopsis
Prototype
AjPFilebuff ajHttpRead (
const AjPStr dbhttpver,
const AjPStr dbname,
const AjPStr dbproxy,
const AjPStr host,
ajint port,
const AjPStr dbpath
);
Type | Name | Read/Write | Description |
const AjPStr | dbhttpver | Input | DB http version |
const AjPStr | dbname | Input | DB name |
const AjPStr | dbproxy | Input | DB proxy |
const AjPStr | host | Input | Host name |
ajint | port | Input | Port |
const AjPStr | dbpath | Input | part of URL after port number |
AjPFilebuff | | RETURN | http response |
Input
dbhttpver: | (Input) | DB http version |
dbname: | (Input) | DB name |
dbproxy: | (Input) | DB proxy |
host: | (Input) | Host name |
port: | (Input) | Port |
dbpath: | (Input) | part of URL after port number |
Returns
AjPFilebuff: | http response |
Description
Reads the header of http response in given buffer buff,
if it includes a redirection response updates the host, port and get
parameters using the 'Location' header
See Also
See other functions in this section
Availability
In release 6.4.0