Merge pull request #267 from Bownairo/master
Adds function addPostDataRaw
This commit is contained in:
commit
e2852d14f1
@ -67,6 +67,14 @@ Result httpcAddRequestHeaderField(httpcContext *context, char* name, char* value
|
||||
*/
|
||||
Result httpcAddPostDataAscii(httpcContext *context, char* name, char* value);
|
||||
|
||||
/**
|
||||
* @brief Adds a POST body to a HTTP context.
|
||||
* @param context Context to use.
|
||||
* @param data The data to be passed as raw into the body of the post request.
|
||||
* @param len Length of data passed by data param.
|
||||
*/
|
||||
Result httpcAddPostDataRaw(httpcContext *context, u32* data, u32 len);
|
||||
|
||||
/**
|
||||
* @brief Begins a HTTP request.
|
||||
* @param context Context to use.
|
||||
@ -178,6 +186,15 @@ Result HTTPC_AddRequestHeaderField(Handle handle, Handle contextHandle, char* na
|
||||
*/
|
||||
Result HTTPC_AddPostDataAscii(Handle handle, Handle contextHandle, char* name, char* value);
|
||||
|
||||
/**
|
||||
* @brief Adds a POST body to a HTTP context.
|
||||
* @param handle HTTPC service handle to use.
|
||||
* @param contextHandle HTTP context handle to use.
|
||||
* @param data Data to be passed as raw into the body of the post request.
|
||||
* @param len Length of data passed by data param.
|
||||
*/
|
||||
Result HTTPC_AddPostDataRaw(Handle handle, Handle contextHandle, u32* data, u32 len);
|
||||
|
||||
/**
|
||||
* @brief Begins a HTTP request.
|
||||
* @param handle HTTPC service handle to use.
|
||||
|
@ -126,6 +126,11 @@ Result httpcAddPostDataAscii(httpcContext *context, char* name, char* value)
|
||||
return HTTPC_AddPostDataAscii(context->servhandle, context->httphandle, name, value);
|
||||
}
|
||||
|
||||
Result httpcAddPostDataRaw(httpcContext *context, u32* data, u32 len)
|
||||
{
|
||||
return HTTPC_AddPostDataRaw(context->servhandle, context->httphandle, data, len);
|
||||
}
|
||||
|
||||
Result httpcBeginRequest(httpcContext *context)
|
||||
{
|
||||
return HTTPC_BeginRequest(context->servhandle, context->httphandle);
|
||||
@ -305,6 +310,24 @@ Result HTTPC_AddPostDataAscii(Handle handle, Handle contextHandle, char* name, c
|
||||
return cmdbuf[1];
|
||||
}
|
||||
|
||||
Result HTTPC_AddPostDataRaw(Handle handle, Handle contextHandle, u32* data, u32 len)
|
||||
{
|
||||
u32* cmdbuf=getThreadCommandBuffer();
|
||||
|
||||
cmdbuf[0]=IPC_MakeHeader(0x14, 2, 2); // 0x140082
|
||||
cmdbuf[1]=contextHandle;
|
||||
cmdbuf[2]=len;
|
||||
cmdbuf[3]=IPC_Desc_Buffer(len, IPC_BUFFER_R);
|
||||
cmdbuf[4]=(u32)data;
|
||||
|
||||
Result ret=0;
|
||||
if(R_FAILED(ret=svcSendSyncRequest(handle)))
|
||||
{
|
||||
return ret;
|
||||
}
|
||||
return cmdbuf[1];
|
||||
}
|
||||
|
||||
Result HTTPC_BeginRequest(Handle handle, Handle contextHandle)
|
||||
{
|
||||
u32* cmdbuf=getThreadCommandBuffer();
|
||||
|
Loading…
Reference in New Issue
Block a user