mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-24 18:24:45 -05:00
ee83b1bcf4
Now there's just CHttpRequest::set_url(URL), no need to specify the host, port and path manually anymore. Updated ChanViewer and Downloader for the API change.
34 lines
594 B
C++
34 lines
594 B
C++
#pragma once
|
|
|
|
#include <AK/AKString.h>
|
|
#include <AK/URL.h>
|
|
|
|
class CNetworkJob;
|
|
|
|
class CHttpRequest {
|
|
public:
|
|
enum Method {
|
|
Invalid,
|
|
HEAD,
|
|
GET,
|
|
POST
|
|
};
|
|
|
|
CHttpRequest();
|
|
~CHttpRequest();
|
|
|
|
const URL& url() const { return m_url; }
|
|
void set_url(const URL& url) { m_url = url; }
|
|
|
|
Method method() const { return m_method; }
|
|
void set_method(Method method) { m_method = method; }
|
|
|
|
String method_name() const;
|
|
ByteBuffer to_raw_request() const;
|
|
|
|
CNetworkJob* schedule();
|
|
|
|
private:
|
|
URL m_url;
|
|
Method m_method { GET };
|
|
};
|