mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 06:57:44 +00:00
Libraries: Create top level directory for libraries.
Things were getting a little crowded in the project root, so this patch moves the Lib*/ directories into Libraries/.
This commit is contained in:
parent
63814ffebf
commit
04b9dc2d30
328 changed files with 36 additions and 36 deletions
44
Libraries/LibCore/CHttpRequest.cpp
Normal file
44
Libraries/LibCore/CHttpRequest.cpp
Normal file
|
@ -0,0 +1,44 @@
|
|||
#include <AK/StringBuilder.h>
|
||||
#include <LibCore/CHttpJob.h>
|
||||
#include <LibCore/CHttpRequest.h>
|
||||
|
||||
CHttpRequest::CHttpRequest()
|
||||
{
|
||||
}
|
||||
|
||||
CHttpRequest::~CHttpRequest()
|
||||
{
|
||||
}
|
||||
|
||||
CNetworkJob* CHttpRequest::schedule()
|
||||
{
|
||||
auto* job = new CHttpJob(*this);
|
||||
job->start();
|
||||
return job;
|
||||
}
|
||||
|
||||
String CHttpRequest::method_name() const
|
||||
{
|
||||
switch (m_method) {
|
||||
case Method::GET:
|
||||
return "GET";
|
||||
case Method::HEAD:
|
||||
return "HEAD";
|
||||
case Method::POST:
|
||||
return "POST";
|
||||
default:
|
||||
ASSERT_NOT_REACHED();
|
||||
}
|
||||
}
|
||||
|
||||
ByteBuffer CHttpRequest::to_raw_request() const
|
||||
{
|
||||
StringBuilder builder;
|
||||
builder.append(method_name());
|
||||
builder.append(' ');
|
||||
builder.append(m_path);
|
||||
builder.append(" HTTP/1.0\r\nHost: ");
|
||||
builder.append(m_hostname);
|
||||
builder.append("\r\n\r\n");
|
||||
return builder.to_byte_buffer();
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue