資源簡介
本代碼借鑒了網(wǎng)上其他大神用C++實(shí)現(xiàn)的post方法,自己經(jīng)過修改并添加了對接收的json數(shù)據(jù)流進(jìn)行了解析的功能
代碼片段和文件信息
//?Httppost.cpp?:?定義控制臺應(yīng)用程序的入口點(diǎn)。
//
#include?“stdafx.h“
#include?“json\json.h“??
#include?
#include?
#include?
#include?
#include?
#include?
using?namespace?std;
char*?request(char*?hostname?char*?api?char*?parameters);
char*?U2G(const?char*?utf8);//貌似還不行
int?_tmain(int?argc?TCHAR*?argv[])
{
???//?initialize?MFC?and?print?and?error?on?failure
????if?(!AfxWinInit(::GetModuleHandle(NULL)?NULL?::GetCommandLine()?0))
????{
????????//?TODO:?change?error?code?to?suit?your?needs
????????_tprintf(_T(“Fatal?Error:?MFC?initialization?failed\n“));
????????return?1;
????}
???//request(“blog.163.com“?“http://blog.163.com/fafaly@126/blog/static/13169329820136315458478/“?“test“);//主機(jī)號+資源URL+發(fā)送的內(nèi)容
char?*recvstr;
recvs
?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----
?????文件???????6240??2013-11-07?17:18??Httppost\Debug\cl.command.1.tlog
?????文件?????117294??2013-11-07?17:18??Httppost\Debug\CL.read.1.tlog
?????文件???????5302??2013-11-07?17:18??Httppost\Debug\CL.write.1.tlog
?????文件???????2458??2013-10-04?18:20??Httppost\Debug\Httppost.Build.CppClean.log
?????文件????????667??2013-11-01?16:08??Httppost\Debug\Httppost.exe.em
?????文件????????732??2013-11-01?16:08??Httppost\Debug\Httppost.exe.em
?????文件????????381??2013-11-07?17:18??Httppost\Debug\Httppost.exe.intermediate.manifest
?????文件?????????90??2013-11-07?17:18??Httppost\Debug\Httppost.lastbuildstate
?????文件???????1011??2013-11-07?17:18??Httppost\Debug\Httppost.log
?????文件?????281654??2013-11-07?17:18??Httppost\Debug\Httppost.obj
?????文件????1245184??2013-11-07?16:39??Httppost\Debug\Httppost.pch
?????文件????????206??2013-10-04?18:23??Httppost\Debug\Httppost_manifest.rc
?????文件?????477736??2013-11-07?16:39??Httppost\Debug\json_reader.obj
?????文件?????954602??2013-11-07?16:39??Httppost\Debug\json_value.obj
?????文件?????458652??2013-11-07?16:39??Httppost\Debug\json_writer.obj
?????文件??????????2??2013-11-07?17:18??Httppost\Debug\li
?????文件??????????2??2013-11-07?17:18??Httppost\Debug\li
?????文件??????????2??2013-11-07?17:18??Httppost\Debug\li
?????文件??????????2??2013-11-07?17:18??Httppost\Debug\li
?????文件??????????2??2013-11-07?17:18??Httppost\Debug\li
?????文件??????????2??2013-11-07?17:18??Httppost\Debug\li
?????文件??????????2??2013-11-07?17:18??Httppost\Debug\li
?????文件??????????2??2013-11-07?17:18??Httppost\Debug\li
?????文件??????????2??2013-11-07?17:18??Httppost\Debug\li
?????文件??????????2??2013-11-07?17:18??Httppost\Debug\li
?????文件??????????2??2013-11-07?17:18??Httppost\Debug\li
?????文件??????????2??2013-11-07?17:18??Httppost\Debug\li
?????文件??????????2??2013-11-07?17:18??Httppost\Debug\li
?????文件??????????2??2013-11-07?17:18??Httppost\Debug\li
?????文件??????????2??2013-11-07?17:18??Httppost\Debug\li
............此處省略96個(gè)文件信息
評論
共有 條評論