Microsoft Information Protection SDK - C 1.17
API Reference Documentation for C
Loading...
Searching...
No Matches
http_delegate_cc.h File Reference

Defines HTTP callback functions. More...

#include <stddef.h>
#include <stdint.h>
#include "mip_cc/common_types_cc.h"
#include "mip_cc/error_cc.h"
#include "mip_cc/mip_macros_cc.h"
#include "mip_cc/result_cc.h"

Go to the source code of this file.

Classes

struct  mip_cc_http_header
 HTTP request/response header. More...
 
struct  mip_cc_http_request
 HTTP request. More...
 
struct  mip_cc_http_response
 HTTP response. More...
 

Typedefs

typedef mip_cc_handlemip_cc_http_delegate
 

Enumerations

enum  mip_cc_http_request_type { HTTP_REQUEST_TYPE_GET = 0 , HTTP_REQUEST_TYPE_POST = 1 }
 HTTP request type. More...
 
enum  mip_cc_http_result { HTTP_RESULT_OK = 0 , HTTP_RESULT_FAILURE = 1 }
 Success/failure state of the HTTP operation. More...
 

Functions

 MIP_CC_CALLBACK (mip_cc_http_send_callback_fn, void, const mip_cc_http_request *, const void *)
 Callback function definition for issuing an HTTP request.
 
 MIP_CC_CALLBACK (mip_cc_http_cancel_callback_fn, void, const char *)
 Callback function definition for cancelling an HTTP request.
 
 MIP_CC_API (mip_cc_result) MIP_CC_CreateHttpDelegate(const mip_cc_http_send_callback_fn sendCallback
 Creates an HTTP delegate which can be used to override MIP's default HTTP stack.
 
 MIP_CC_API (void) MIP_CC_NotifyHttpDelegateResponse(const mip_cc_http_delegate httpDelegate
 Notifies an HTTP delegate that an HTTP response is ready.
 

Variables

const mip_cc_http_cancel_callback_fn cancelCallback
 
const mip_cc_http_cancel_callback_fn mip_cc_http_delegatehttpDelegate
 
const mip_cc_http_cancel_callback_fn mip_cc_http_delegate mip_cc_errorerrorInfo
 
const char * requestId
 
const char const mip_cc_http_result result
 
const char const mip_cc_http_result const mip_cc_http_responseresponse
 

Detailed Description

Defines HTTP callback functions.

Typedef Documentation

◆ mip_cc_http_delegate

Enumeration Type Documentation

◆ mip_cc_http_request_type

HTTP request type.

Enumerator
HTTP_REQUEST_TYPE_GET 

HTTP GET

HTTP_REQUEST_TYPE_POST 

HTTP POST

◆ mip_cc_http_result

Success/failure state of the HTTP operation.

Enumerator
HTTP_RESULT_OK 

HTTP operation was completed successfull

HTTP_RESULT_FAILURE 

HTTP operation failed (e.g. timeout, network failure, etc.)

Function Documentation

◆ MIP_CC_API() [1/2]

MIP_CC_API ( mip_cc_result ) const

Creates an HTTP delegate which can be used to override MIP's default HTTP stack.

Parameters
sendCallbackFunction pointer for issuing HTTP requests
cancelCallbackFunction pointer for cancelling HTTP requests
httpDelegate[Output] Handle to HTTP delegate object
errorInfo[Output] (Optional) Failure info if operation result is error
Returns
Result code indicating success or failure

◆ MIP_CC_API() [2/2]

MIP_CC_API ( void ) const

Notifies an HTTP delegate that an HTTP response is ready.

Release resources associated with an HTTP delegate handle.

Parameters
httpDelegateHandle to HTTP delegate object
requestIdID of HTTP request associated with this operation
resultSuccess/failure state of operation
responseThe HTTP response if operation succeeded, else nullptr
Note
This function must be called by the application when an HTTP operation has completed. The ID of the HTTP response must match the ID of the HTTP request to allow MIP to correlate a response with its request
Parameters
httpDelegateHTTP delegate to be released

◆ MIP_CC_CALLBACK() [1/2]

MIP_CC_CALLBACK ( mip_cc_http_cancel_callback_fn ,
void ,
const char *  )

Callback function definition for cancelling an HTTP request.

Parameters
requestIdThe ID of the HTTP request to be cancelled

◆ MIP_CC_CALLBACK() [2/2]

MIP_CC_CALLBACK ( mip_cc_http_send_callback_fn ,
void ,
const mip_cc_http_request * ,
const void *  )

Callback function definition for issuing an HTTP request.

Parameters
requestThe HTTP request to be performed by the application
contextThe same opaque context passed to MIP API call that resulted in this HTTP request

Variable Documentation

◆ cancelCallback

const mip_cc_http_cancel_callback_fn cancelCallback

◆ errorInfo

const mip_cc_http_cancel_callback_fn mip_cc_http_delegate mip_cc_error* errorInfo

◆ httpDelegate

const mip_cc_http_cancel_callback_fn mip_cc_http_delegate* httpDelegate

◆ requestId

const char* requestId

◆ response

const char const mip_cc_http_result const mip_cc_http_response* response

◆ result

const char const mip_cc_http_result result