mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
refine http request post. 2.0.132.
This commit is contained in:
parent
3982ec1d87
commit
964e4be9d4
6 changed files with 88 additions and 259 deletions
|
@ -54,9 +54,9 @@ SrsHttpClient::~SrsHttpClient()
|
|||
srs_freep(parser);
|
||||
}
|
||||
|
||||
int SrsHttpClient::post(SrsHttpUri* uri, string req, int& status_code, string& res)
|
||||
int SrsHttpClient::post(SrsHttpUri* uri, string req, SrsHttpMessage** ppmsg)
|
||||
{
|
||||
res = "";
|
||||
*ppmsg = NULL;
|
||||
|
||||
int ret = ERROR_SUCCESS;
|
||||
|
||||
|
@ -103,16 +103,7 @@ int SrsHttpClient::post(SrsHttpUri* uri, string req, int& status_code, string& r
|
|||
}
|
||||
|
||||
srs_assert(msg);
|
||||
|
||||
// always free it in this scope.
|
||||
SrsAutoFree(SrsHttpMessage, msg);
|
||||
|
||||
status_code = (int)msg->status_code();
|
||||
|
||||
// get response body.
|
||||
if ((ret = msg->body_read_all(res)) != ERROR_SUCCESS) {
|
||||
return ret;
|
||||
}
|
||||
*ppmsg = msg;
|
||||
srs_info("parse http post response success.");
|
||||
|
||||
return ret;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue