mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
adding http request for test server in sign transaction
This commit is contained in:
parent
f4f0b0fa2b
commit
8d6ae27071
@ -142,18 +142,26 @@ int SigningTransaction::run() {
|
||||
|
||||
// send post request via https
|
||||
// 443 = HTTPS Default
|
||||
// or http via port 80 if it is a test server
|
||||
// TODO: adding port into ServerConfig
|
||||
try {
|
||||
Profiler phpRequestTime;
|
||||
Poco::Net::HTTPSClientSession httpsClientSession(ServerConfig::g_php_serverHost, 443);
|
||||
Poco::Net::HTTPClientSession* clientSession = nullptr;
|
||||
if (ServerConfig::SERVER_TYPE_PRODUCTION == ServerConfig::g_ServerSetupType ||
|
||||
ServerConfig::SERVER_TYPE_STAGING == ServerConfig::g_ServerSetupType) {
|
||||
clientSession = new Poco::Net::HTTPSClientSession(ServerConfig::g_php_serverHost, 443);
|
||||
}
|
||||
else {
|
||||
clientSession = new Poco::Net::HTTPClientSession(ServerConfig::g_php_serverHost, 80);
|
||||
}
|
||||
Poco::Net::HTTPRequest request(Poco::Net::HTTPRequest::HTTP_POST, "/JsonRequestHandler");
|
||||
|
||||
request.setChunkedTransferEncoding(true);
|
||||
std::ostream& requestStream = httpsClientSession.sendRequest(request);
|
||||
std::ostream& requestStream = clientSession->sendRequest(request);
|
||||
requestJson.stringify(requestStream);
|
||||
|
||||
Poco::Net::HTTPResponse response;
|
||||
std::istream& request_stream = httpsClientSession.receiveResponse(response);
|
||||
std::istream& request_stream = clientSession->receiveResponse(response);
|
||||
|
||||
// debugging answer
|
||||
|
||||
@ -199,6 +207,7 @@ int SigningTransaction::run() {
|
||||
sendErrorsAsEmail();
|
||||
return -10;
|
||||
}
|
||||
delete clientSession;
|
||||
//printf("state: %s\n", stateString.data());
|
||||
//int zahl = 1;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user