Make a request to a specified server using POST.
int okutil_http_post( LPCSTR lpcszURL, LPCSTR lpcszRequestData, string * pstrResult, int nConnectTimeout = 0, int nResponseTimeout = 30 )
0 if succcess, otherwise an negative error code
EX1
void molecule() { string strURL = "https://pubchem.ncbi.nlm.nih.gov/rest/pug/compound/cid/property/MolecularFormula,MolecularWeight/JSON"; string strRequest = "cid=1,2,3,4,5"; string result; int err = okutil_http_post(strURL, strRequest, &result); if(0==err) { Tree tr; JSON.FromString(tr, result); out_tree(tr); } }
origin.h