LiuChangFreeman / HttpClient

Code for Linux,Http client which can send GET/POST requests

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

HttpClient

Usage: add header as "HttpClient.h"

Declare: HttpClient httpclient;

You need to add http-RequestHeaders as yourselves: httpclient.AddRequestHeader("Content-Type","application/x-www-form-urlencoded");

Simply use a string URL to GET: string Url = "http://tjservice.cn/campus"; string result = httpclient.GetUrl(Url);

Use a map to POST data to URL: Url = "http://tjservice.cn/build"; map<string, string> data; data["campus"] = "1"; result=httpclient.PostUrl(Url,data);

Use clear to reuse a HttpClient: httpclient.clear();

About

Code for Linux,Http client which can send GET/POST requests

License:MIT License


Languages

Language:C++ 98.0%Language:Makefile 2.0%