DynXX-C
Loading...
Searching...
No Matches
Enumerations | Functions
Net.h File Reference
#include "Types.h"
#include <stdio.h>

Go to the source code of this file.

Enumerations

enum  DynXXHttpMethod { DynXXHttpMethodGet , DynXXHttpMethodPost , DynXXHttpMethodPut }
 

Functions

const char * dynxx_net_http_request (const char *url, const char *params, DynXXHttpMethod method, const char **header_v, size_t header_c, const char **form_field_name_v, const char **form_field_mime_v, const char **form_field_data_v, size_t form_field_count, FILE *cFILE, size_t file_size, size_t timeout)
 http request
 
bool dynxx_net_http_download (const char *url, const char *file_path, size_t timeout)
 download file
 

Enumeration Type Documentation

◆ DynXXHttpMethod

HTTP method

Enumerator
DynXXHttpMethodGet 
DynXXHttpMethodPost 
DynXXHttpMethodPut 

Function Documentation

◆ dynxx_net_http_download()

bool dynxx_net_http_download ( const char *  url,
const char *  file_path,
size_t  timeout 
)

download file

Parameters
urlfile URL
file_pathfile path
timeoutTimeout(milliseconds)
Returns
download result

◆ dynxx_net_http_request()

const char * dynxx_net_http_request ( const char *  url,
const char *  params,
DynXXHttpMethod  method,
const char **  header_v,
size_t  header_c,
const char **  form_field_name_v,
const char **  form_field_mime_v,
const char **  form_field_data_v,
size_t  form_field_count,
FILE *  cFILE,
size_t  file_size,
size_t  timeout 
)

http request

Parameters
urlURL
paramsparams(transfer multiple params like v1=a&v2=b)
methodHTTP method, see DynXXHttpMethod
header_vHTTP header vector, max length is DYNXX_HTTP_HEADER_MAX_LENGTH
header_cHTTP header count, max count is DYNXX_HTTP_HEADER_MAX_COUNT
form_field_name_vForm field name vector, max length is DYNXX_HTTP_FORM_FIELD_NAME_MAX_LENGTH
form_field_mime_vForm field mime vector, max length is DYNXX_HTTP_FORM_FIELD_MIME_MAX_LENGTH
form_field_data_vForm field data bytes vector, max length is DYNXX_HTTP_FORM_FIELD_DATA_MAX_LENGTH
form_field_countForm field count, max ount is DYNXX_HTTP_FORM_FIELD_MAX_COUNT
cFILEA FILE (pointer) to PUT
file_sizeFile size
timeoutTimeout(milliseconds)
Returns
response