ajhttp.c


Function ajHttpGetProxyinfo

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.

Prototype

AjBool ajHttpGetProxyinfo (
      const AjPStr dbproxy,
      ajint* proxyport,
      AjPStr* proxyname,
      AjPStr* proxyauth,
      AjPStr* proxycreds
);

TypeNameRead/WriteDescription
const AjPStrdbproxyInputPrimary proxy string (if any)
ajint*proxyportOutputProxy port
AjPStr*proxynameOutputProxy name
AjPStr*proxyauthOutputProxy authentication type (if any)
AjPStr*proxycredsOutputProxy auth credentials (if any)
AjBool RETURNajTrue if a proxy was defined

From EMBOSS 6.4.0


Function ajHttpGetVersion

Returns the HTTP version. Any supplied version takes precedence over an EMBOSS_HTTPVERSION definition so allowing DB entries to override such a setting.

Prototype

AjBool ajHttpGetVersion (
      const AjPStr version,
      AjPStr* httpver
);

TypeNameRead/WriteDescription
const AjPStrversionInputVersion or NULL (or zero-length string)
AjPStr*httpverOutputHTTP version
AjBool RETURNajTrue if a version was defined

From EMBOSS 6.4.0


Function ajHttpOpen

Opens an HTTP connection

Prototype

FILE* ajHttpOpen (
      const AjPStr dbname,
      const AjPStr host,
      ajint iport,
      const AjPStr get,
      struct AJSOCKET* Psock
);

TypeNameRead/WriteDescription
const AjPStrdbnameInputDatabase name (for error reporting)
const AjPStrhostInputHost name
ajintiportInputPort
const AjPStrgetInputGET string
struct AJSOCKET*PsockModifySocket returned to caller
FILE* RETURNOpen file on success, NULL on failure

From EMBOSS 6.4.0


Function ajHttpOpenProxy

Opens an HTTP connection via a proxy

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
);

TypeNameRead/WriteDescription
const AjPStrdbnameInputDatabse name (for error reporting)
const AjPStrproxynameInputProxy name
ajintproxyportInputProxy port
const AjPStrproxyauthInputProxy auth type (if any)
const AjPStrproxycredsInputProxy auth credentials (if any)
const AjPStrhostInputHost name
ajintiportInputPort
const AjPStrgetInputGET string
struct AJSOCKET*PsockModifySocket returned to caller
FILE* RETURNOpen file on success, NULL on failure

From EMBOSS 6.4.0


Function ajHttpUrlrefNew

Initialise a URL components object

Prototype

AjPUrlref ajHttpUrlrefNew (
      void
);

TypeNameRead/WriteDescription
AjPUrlref RETURNURL Components

From EMBOSS 6.4.0


Function ajHttpUrlrefDel

Delete URL components object

Prototype

void ajHttpUrlrefDel (
      AjPUrlref* thys
);

TypeNameRead/WriteDescription
AjPUrlref*thysModifyURL components object
void RETURN

From EMBOSS 6.4.0


Function ajHttpUrlrefParseC

Parse an IPV4/6 URL into its components

Prototype

void ajHttpUrlrefParseC (
      AjPUrlref* parts,
      const char* url
);

TypeNameRead/WriteDescription
AjPUrlref*partsModifyURL components object
const char*urlModifyURL
void RETURN

From EMBOSS 6.4.0


Function ajHttpUrlrefSplitPort

Separate any port from a host specification (IPV4/6)

Prototype

void ajHttpUrlrefSplitPort (
      AjPUrlref urli
);

TypeNameRead/WriteDescription
AjPUrlrefurliModifyURL components object
void RETURN

From EMBOSS 6.4.0


Function ajHttpUrlrefSplitUsername

Separate any username[:password] from a host specification (IPV4/6)

Prototype

void ajHttpUrlrefSplitUsername (
      AjPUrlref urli
);

TypeNameRead/WriteDescription
AjPUrlrefurliModifyURL components object
void RETURN

From EMBOSS 6.4.0


Function ajHttpQueryUrl

Returns the components of a URL (IPV4/6) An equivalent for seqHttpUrl().

Prototype

AjBool ajHttpQueryUrl (
      const AjPQuery qry,
      ajint* iport,
      AjPStr* host,
      AjPStr* urlget
);

TypeNameRead/WriteDescription
const AjPQueryqryInputDatabase query
ajint*iportOutputPort
AjPStr*hostOutputHost name
AjPStr*urlgetOutputURL for the HTTP header GET
AjBool RETURNajTrue if the URL was parsed

From EMBOSS 6.4.0


Function ajHttpUrlDeconstruct

Deconstruct a URL (IPV4/6)

Prototype

void ajHttpUrlDeconstruct (
      const AjPStr url,
      ajint* iport,
      AjPStr* host,
      AjPStr* urlget
);

TypeNameRead/WriteDescription
const AjPStrurlInputurl
ajint*iportOutputPort
AjPStr*hostOutputHost name
AjPStr*urlgetOutputURL for the HTTP header GET
void RETURN

From EMBOSS 6.4.0


Function ajHttpRedirect

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

Prototype

AjBool ajHttpRedirect (
      AjPFilebuff buff,
      AjPStr* host,
      ajint* port,
      AjPStr* path
);

TypeNameRead/WriteDescription
AjPFilebuffbuffModifyfile buffer
AjPStr*hostOutputHost name
ajint*portOutputPort
AjPStr*pathOutputpart of URL after port number
AjBool RETURNreturns true if the header includes a redirection response

From EMBOSS 6.4.0


Function ajHttpRead

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

Prototype

AjPFilebuff ajHttpRead (
      const AjPStr dbhttpver,
      const AjPStr dbname,
      const AjPStr dbproxy,
      const AjPStr host,
      ajint port,
      const AjPStr dbpath
);

TypeNameRead/WriteDescription
const AjPStrdbhttpverInputDB http version
const AjPStrdbnameInputDB name
const AjPStrdbproxyInputDB proxy
const AjPStrhostInputHost name
ajintportInputPort
const AjPStrdbpathInputpart of URL after port number
AjPFilebuff RETURNhttp response

From EMBOSS 6.4.0