参考资料:
http://apps.hi.baidu.com/share/detail/39003388
http://blog.youkuaiyun.com/yc0188/article/details/4741871
http://bbs.chinaunix.net/thread-2094334-1-1.html
//头文件
#include <iostream>
#include <string>
#include <Winsock2.h>
using namespace std;
//函数声明
int request(char* hostname, char* api, char* parameters);
//方法调用
int _tmain(int argc, TCHAR* argv[], TCHAR* envp[])
{
int nRetCode = 0;
// initialize MFC and print and error on failure
if (!AfxWinInit(::GetModuleHandle(NULL), NULL, ::GetCommandLine(), 0))