FreeRDP
utils/http.c File Reference
#include <freerdp/config.h>
#include <freerdp/utils/http.h>
#include <winpr/assert.h>
#include <winpr/string.h>
#include <openssl/bio.h>
#include <openssl/ssl.h>
#include <openssl/err.h>
#include <freerdp/log.h>

Macros

#define TAG   FREERDP_TAG("utils.http")
 
#define log_errors(log, msg)   log_errors_(log, msg, __FILE__, __func__, __LINE__)
 

Functions

static void log_errors_ (wLog *log, const char *msg, const char *file, const char *fkt, size_t line)
 
static int get_line (BIO *bio, char *buffer, size_t size)
 
BOOL freerdp_http_request (const char *url, const char *body, long *status_code, BYTE **response, size_t *response_length)
 
const char * freerdp_http_status_string (long status)
 
char * freerdp_http_status_string_format (long status, char *buffer, size_t size)
 

Variables

static const char get_header_fmt []
 
static const char post_header_fmt []
 

Macro Definition Documentation

◆ log_errors

#define log_errors (   log,
  msg 
)    log_errors_(log, msg, __FILE__, __func__, __LINE__)

◆ TAG

#define TAG   FREERDP_TAG("utils.http")

FreeRDP: A Remote Desktop Protocol Implementation Simple HTTP client request utility

Copyright 2023 Isaac Klein fifth.nosp@m.degr.nosp@m.ee@pr.nosp@m.oton.nosp@m.mail..nosp@m.com

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Function Documentation

◆ freerdp_http_request()

BOOL freerdp_http_request ( const char *  url,
const char *  body,
long *  status_code,
BYTE **  response,
size_t *  response_length 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ freerdp_http_status_string()

const char* freerdp_http_status_string ( long  status)
Here is the caller graph for this function:

◆ freerdp_http_status_string_format()

char* freerdp_http_status_string_format ( long  status,
char *  buffer,
size_t  size 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_line()

static int get_line ( BIO *  bio,
char *  buffer,
size_t  size 
)
static
Here is the caller graph for this function:

◆ log_errors_()

static void log_errors_ ( wLog *  log,
const char *  msg,
const char *  file,
const char *  fkt,
size_t  line 
)
static
Here is the call graph for this function:

Variable Documentation

◆ get_header_fmt

const char get_header_fmt[]
static
Initial value:
= "GET %s HTTP/1.1\r\n"
"Host: %s\r\n"
"\r\n"

◆ post_header_fmt

const char post_header_fmt[]
static
Initial value:
= "POST %s HTTP/1.1\r\n"
"Host: %s\r\n"
"Content-Type: application/x-www-form-urlencoded\r\n"
"Content-Length: %lu\r\n"
"\r\n"