An open API service indexing awesome lists of open source software.

https://github.com/perrywerneck/libudjathttp

HTTP Client library and protocol handler for UDJAT.
https://github.com/perrywerneck/libudjathttp

Last synced: 2 months ago
JSON representation

HTTP Client library and protocol handler for UDJAT.

Awesome Lists containing this project

README

        

# HTTP Client library for UDJAT.

Windows/Linux http client library module for libudjat based applications.

[![License: GPL v3](https://img.shields.io/badge/License-GPL%20v3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)
[![build result](https://build.opensuse.org/projects/home:PerryWerneck:udjat/packages/libudjathttp/badge.svg?type=percent)](https://build.opensuse.org/package/show/home:PerryWerneck:udjat/libudjathttp)

## Installation

# Sample use

## As a library

### Authenticated get

```C++
cout <<
HTTP::Client("http://localhost/sample")
.setCredentials("userid","passwd")
.get()
<< endl;
```

### Post with variable parsing

This post expands ${} values with network info extracted from the active connection.

```C++
HTTP::Client("http://localhost").post(
"ipaddr='${ipaddr}'\n"
"hostip='${hostip}'\n"
"nic='${network-interface}'\n"
"macaddress='${macaddress}'"
);
```

### Save to file

```C++
HTTP::Client("http://localhost").save("test.html")
```