15 HTTPC_METHOD_GET = 0x1,
16 HTTPC_METHOD_POST = 0x2,
17 HTTPC_METHOD_HEAD = 0x3,
18 HTTPC_METHOD_PUT = 0x4,
19 HTTPC_METHOD_DELETE = 0x5
30 HTTPC_KEEPALIVE_DISABLED = 0x0,
31 HTTPC_KEEPALIVE_ENABLED = 0x1
35 #define HTTPC_RESULTCODE_DOWNLOADPENDING 0xd840a02b
38 #define HTTPC_RESULTCODE_NOTFOUND 0xd840a028
41 #define HTTPC_RESULTCODE_TIMEDOUT 0xd820a069
Result httpcGetResponseStatusCode(httpcContext *context, u32 *out)
Gets the response code of the HTTP context.
Result httpcBeginRequest(httpcContext *context)
Begins a HTTP request.
Result httpcOpenClientCertContext(const u8 *cert, u32 certsize, const u8 *privk, u32 privk_size, u32 *ClientCert_contexthandle)
Opens a ClientCert-context.
Result httpcGetResponseHeader(httpcContext *context, const char *name, char *value, u32 valuebuf_maxsize)
Gets a response header field from a HTTP context.
Result httpcOpenDefaultClientCertContext(SSLC_DefaultClientCert certID, u32 *ClientCert_contexthandle)
Opens a ClientCert-context with a default clientclient.
Result httpcAddPostDataBinary(httpcContext *context, const char *name, const u8 *value, u32 len)
Adds a POST form field with binary data to a HTTP context.
Result httpcGetDownloadSizeState(httpcContext *context, u32 *downloadedsize, u32 *contentsize)
Gets the download size state of a HTTP context.
Result httpcSetKeepAlive(httpcContext *context, HTTPC_KeepAlive option)
Sets Keep-Alive for the context.
Result httpcAddTrustedRootCA(httpcContext *context, const u8 *cert, u32 certsize)
Adds a trusted RootCA cert to a HTTP context.
Result httpcAddPostDataAscii(httpcContext *context, const char *name, const char *value)
Adds a POST form field to a HTTP context.
Result httpcAddDefaultCert(httpcContext *context, SSLC_DefaultRootCert certID)
Adds a default RootCA cert to a HTTP context.
Result httpcDestroyRootCertChain(u32 RootCertChain_contexthandle)
Destroy a RootCertChain.
Result httpcCloseClientCertContext(u32 ClientCert_contexthandle)
Closes a ClientCert context.
Result httpcSelectRootCertChain(httpcContext *context, u32 RootCertChain_contexthandle)
Sets the RootCertChain for a HTTP context.
Result httpcReceiveDataTimeout(httpcContext *context, u8 *buffer, u32 size, u64 timeout)
Receives data from a HTTP context with a timeout value.
Result httpcAddRequestHeaderField(httpcContext *context, const char *name, const char *value)
Adds a request header field to a HTTP context.
Result httpcInit(u32 sharedmem_size)
Initializes HTTPC. For HTTP GET the sharedmem_size can be zero. The sharedmem contains data which wil...
Result httpcDownloadData(httpcContext *context, u8 *buffer, u32 size, u32 *downloadedsize)
Downloads data from the HTTP context into a buffer.
Result httpcSetClientCertDefault(httpcContext *context, SSLC_DefaultClientCert certID)
Sets the default clientcert for a HTTP context.
Result httpcReceiveData(httpcContext *context, u8 *buffer, u32 size)
Receives data from a HTTP context.
Result httpcOpenContext(httpcContext *context, HTTPC_RequestMethod method, const char *url, u32 use_defaultproxy)
Opens a HTTP context.
Result httpcGetRequestState(httpcContext *context, HTTPC_RequestStatus *out)
Gets the request state of a HTTP context.
HTTPC_KeepAlive
HTTP KeepAlive option.
Definition: httpc.h:29
void httpcExit(void)
Exits HTTPC.
Result httpcAddPostDataRaw(httpcContext *context, const u32 *data, u32 len)
Adds a POST body to a HTTP context.
HTTPC_RequestMethod
HTTP request method.
Definition: httpc.h:14
Result httpcCancelConnection(httpcContext *context)
Cancels a HTTP connection.
Result httpcRootCertChainAddDefaultCert(u32 RootCertChain_contexthandle, SSLC_DefaultRootCert certID, u32 *cert_contexthandle)
Adds a default RootCA cert to a RootCertChain.
Result httpcSetClientCert(httpcContext *context, const u8 *cert, u32 certsize, const u8 *privk, u32 privk_size)
Sets the ClientCert for a HTTP context.
Result httpcSetSSLOpt(httpcContext *context, u32 options)
Sets SSL options for the context.
Result httpcSetClientCertContext(httpcContext *context, u32 ClientCert_contexthandle)
Sets the ClientCert contexthandle for a HTTP context.
Result httpcSetSSLClearOpt(httpcContext *context, u32 options)
Sets the SSL options which will be cleared for the context.
Result httpcGetResponseStatusCodeTimeout(httpcContext *context, u32 *out, u64 timeout)
Gets the response code of the HTTP context with a timeout value.
HTTPC_RequestStatus
HTTP request status.
Definition: httpc.h:23
@ HTTPC_STATUS_DOWNLOAD_READY
Download ready.
Definition: httpc.h:25
@ HTTPC_STATUS_REQUEST_IN_PROGRESS
Request in progress.
Definition: httpc.h:24
Result httpcCloseContext(httpcContext *context)
Closes a HTTP context.
Result httpcCreateRootCertChain(u32 *RootCertChain_contexthandle)
Creates a RootCertChain.
Result httpcRootCertChainRemoveCert(u32 RootCertChain_contexthandle, u32 cert_contexthandle)
Removes a cert from a RootCertChain.
Result httpcRootCertChainAddCert(u32 RootCertChain_contexthandle, const u8 *cert, u32 certsize, u32 *cert_contexthandle)
Adds a RootCA cert to a RootCertChain.
HTTP context.
Definition: httpc.h:8
Handle servhandle
Service handle.
Definition: httpc.h:9
u32 httphandle
HTTP handle.
Definition: httpc.h:10
uint64_t u64
64-bit unsigned integer
Definition: types.h:24
uint8_t u8
would be nice if newlib had this already
Definition: types.h:21
u32 Handle
Resource handle.
Definition: types.h:41
s32 Result
Function result.
Definition: types.h:42
uint32_t u32
32-bit unsigned integer
Definition: types.h:23