26 lines
510 B
C++
26 lines
510 B
C++
|
#include "NetworkManager.h"
|
||
|
|
||
|
#include "TestFramework.h"
|
||
|
#include "TestUtils.h"
|
||
|
|
||
|
#include "HttpClient.h"
|
||
|
#include "File.h"
|
||
|
|
||
|
TEST_CASE(TestWinsockClient, "network")
|
||
|
{
|
||
|
HttpClient client;
|
||
|
|
||
|
HttpRequest request(HttpRequest::Verb::GET);
|
||
|
|
||
|
HttpClient::Address address;
|
||
|
address.mHost = "127.0.0.1";
|
||
|
address.mPort = 8000;
|
||
|
|
||
|
auto response = client.makeRequest(request, address);
|
||
|
|
||
|
auto content = response.toString();
|
||
|
|
||
|
File file(TestUtils::getTestOutputDir(__FILE__) / "get_request.dat");
|
||
|
file.writeText(content);
|
||
|
}
|