Microsoft Information Protection (MIP) SDK for C: Reference 1.15
Doxygen-generated documentation for MIP SDK written in 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"
+ Include dependency graph for http_delegate_cc.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

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_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.
 
 MIP_CC_CALLBACK (mip_cc_http_cancel_callback_fn, void, const char *)
 Callback function definition for cancelling an HTTP request.
 
 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.
 

Variables

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

Detailed Description

Defines HTTP callback functions.

Definition in file http_delegate_cc.h.

Typedef Documentation

◆ mip_cc_http_delegate

Definition at line 114 of file http_delegate_cc.h.

Enumeration Type Documentation

◆ mip_cc_http_request_type

HTTP request type.

Enumerator
HTTP_REQUEST_TYPE_GET 

HTTP GET.

HTTP_REQUEST_TYPE_POST 

HTTP POST.

Definition at line 48 of file http_delegate_cc.h.

48 {
49 HTTP_REQUEST_TYPE_GET = 0, /**< HTTP GET */
50 HTTP_REQUEST_TYPE_POST = 1, /**< HTTP POST */
mip_cc_http_request_type
HTTP request type.
@ 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.)

Definition at line 56 of file http_delegate_cc.h.

56 {
57 HTTP_RESULT_OK = 0, /**< HTTP operation was completed successfull */
58 HTTP_RESULT_FAILURE = 1, /**< HTTP operation failed (e.g. timeout, network failure, etc.) */
mip_cc_http_result
Success/failure state of the HTTP operation.
@ HTTP_RESULT_FAILURE
HTTP operation failed (e.g.
@ HTTP_RESULT_OK
HTTP operation was completed successfull.

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

Definition at line 128 of file http_delegate_cc.h.

◆ errorInfo

const mip_cc_http_cancel_callback_fn mip_cc_http_delegate mip_cc_error* errorInfo

Definition at line 130 of file http_delegate_cc.h.

◆ httpDelegate

const mip_cc_http_cancel_callback_fn mip_cc_http_delegate* httpDelegate

Definition at line 129 of file http_delegate_cc.h.

◆ requestId

const char* requestId

Definition at line 145 of file http_delegate_cc.h.

◆ response

const char const mip_cc_http_result const mip_cc_http_response* response

Definition at line 147 of file http_delegate_cc.h.

◆ result

const char const mip_cc_http_result result

Definition at line 146 of file http_delegate_cc.h.