1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 17:47:44 +00:00

Start working on a Downloader app and backing classes in LibGUI.

LibGUI is slowly becoming LibKitchensink but I'm okay with this for now.
This commit is contained in:
Andreas Kling 2019-04-07 14:36:10 +02:00
parent c7365a00f8
commit 8f30657390
21 changed files with 375 additions and 1 deletions

34
LibGUI/GHttpRequest.h Normal file
View file

@ -0,0 +1,34 @@
#pragma once
#include <AK/AKString.h>
class GNetworkJob;
class GHttpRequest {
public:
enum Method { Invalid, HEAD, GET, POST };
GHttpRequest();
~GHttpRequest();
String hostname() const { return m_hostname; }
int port() const { return m_port; }
String path() const { return m_path; }
Method method() const { return m_method; }
void set_hostname(const String& hostname) { m_hostname = hostname; }
void set_port(int port) { m_port = port; }
void set_path(const String& path) { m_path = path; }
void set_method(Method method) { m_method = method; }
String method_name() const;
ByteBuffer to_raw_request() const;
GNetworkJob* schedule();
private:
String m_hostname;
String m_path;
int m_port { 80 };
Method m_method { GET };
};