Skip to content

Commit

Permalink
Made getFile function actually return file
Browse files Browse the repository at this point in the history
  • Loading branch information
boomanaiden154 committed Apr 24, 2020
1 parent 22cacf7 commit 0c4ff10
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions client.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ class HTTPClient
return sockfd;
}

static void getFile(std::string uri)
static std::string getFile(std::string uri)
{
struct uri websiteURI = parseURI(uri);
int port = websiteURI.port == -1 ? 80 : websiteURI.port;
Expand Down Expand Up @@ -298,6 +298,6 @@ class HTTPClient
response.parse(std::string(buffer));
}

std::cout << response.getHeaderString() << std::endl;
return response.body;
}
};
Binary file modified test
Binary file not shown.
2 changes: 1 addition & 1 deletion test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@

int main()
{
HTTPClient::getFile("http://neverssl.com/");
std::cout << HTTPClient::getFile("http://neverssl.com/") << std::endl;
return 0;
}

0 comments on commit 0c4ff10

Please sign in to comment.