More work toward http/https client unification.

This commit is contained in:
Arthur Britto
2013-01-31 13:07:37 -08:00
parent 48cf9df7a6
commit fb1cd25f28
8 changed files with 327 additions and 255 deletions

View File

@@ -39,7 +39,7 @@ Json::Value JSONRPCError(int code, const std::string& message)
// and to be compatible with other JSON-RPC implementations.
//
std::string createHTTPPost(const std::string& strPath, const std::string& strMsg, const std::map<std::string, std::string>& mapRequestHeaders)
std::string createHTTPPost(const std::string& strHost, const std::string& strPath, const std::string& strMsg, const std::map<std::string, std::string>& mapRequestHeaders)
{
std::ostringstream s;
@@ -47,7 +47,7 @@ std::string createHTTPPost(const std::string& strPath, const std::string& strMsg
<< (strPath.empty() ? "/" : strPath)
<< " HTTP/1.1\r\n"
<< "User-Agent: " SYSTEM_NAME "-json-rpc/" << FormatFullVersion() << "\r\n"
<< "Host: 127.0.0.1\r\n"
<< "Host: " << strHost << "\r\n"
<< "Content-Type: application/json\r\n"
<< "Content-Length: " << strMsg.size() << "\r\n"
<< "Accept: application/json\r\n";