ESP8266 part of the f105-motor-demo project (see f105-motor-demo_stm32)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Ondřej Hruška 48de8fffa0 js poll status; shorter logging 6 years ago
LICENSE removed junk, fixed license mess 6 years ago working http request 6 years ago
httpclient.c js poll status; shorter logging 6 years ago
httpclient.h js poll status; shorter logging 6 years ago


This is a short library for ESP8266(EX) chips to make HTTP requests.


  • Easy to use.
  • Supports multiple requests in parallel.
  • Supports GET and POST requests.
  • Tested with Espressif SDK v1.0.0


If you don't have a toolchain yet, install one with then get Espressif's SDK.

The submodule way

If your project looks like esphttpd from Sprite_tm:

git clone
cd esphttpd
git submodule add lib/esphttpclient
git submodule update --init

Now append lib/esphttpclient to the following Makefile line and you should be ready:

MODULES = driver user lib/esphttpclient

In case you want to use SSL don't forget to add ssl to LIBS in the Makefile

LIBS = c gcc hal pp phy net80211 lwip wpa main ssl

The dirty way

Alternatively you could create a simple project:

git clone
cd source-code-examples/basic_example
# Set your Wifi credentials in user_config.h
# I could not test this because of the UART baud rate (74880)

Then download this library and move the files to user/:

git clone
mv esphttpclient/*.* user/


Include httpclient.h from user_main.c then call one of these functions:

void http_get(const char * url, const char * headers, http_callback user_callback);
void http_post(const char * url, const char * post_data, const char * headers, http_callback user_callback);

void http_callback_example(char * response_body, int http_status, char * response_headers, int body_size)
	os_printf("http_status=%d\n", http_status);
	if (http_status != HTTP_STATUS_GENERIC_ERROR) {
		os_printf("strlen(headers)=%d\n", strlen(response_headers));
		os_printf("body_size=%d\n", body_size);
		os_printf("body=%s<EOF>\n", response_body);


The following code performs a single request, then calls http_callback_example to display your public IP address.

http_get("", "", http_callback_example);

The output looks like this: