mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 07:32:44 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			34 lines
		
	
	
	
		
			599 B
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			34 lines
		
	
	
	
		
			599 B
		
	
	
	
		
			C++
		
	
	
	
	
	
| #pragma once
 | |
| 
 | |
| #include <AK/String.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;
 | |
| 
 | |
|     RefPtr<CNetworkJob> schedule();
 | |
| 
 | |
| private:
 | |
|     URL m_url;
 | |
|     Method m_method { GET };
 | |
| };
 | 
