CHttpResponse.h 658 B

1234567891011121314151617181920212223
  1. #pragma once
  2. #include <AK/String.h>
  3. #include <AK/HashMap.h>
  4. #include <LibCore/CNetworkResponse.h>
  5. class CHttpResponse : public CNetworkResponse {
  6. public:
  7. virtual ~CHttpResponse() override;
  8. static NonnullRefPtr<CHttpResponse> create(int code, HashMap<String, String>&& headers, ByteBuffer&& payload)
  9. {
  10. return adopt(*new CHttpResponse(code, move(headers), move(payload)));
  11. }
  12. int code() const { return m_code; }
  13. const HashMap<String, String>& headers() const { return m_headers; }
  14. private:
  15. CHttpResponse(int code, HashMap<String, String>&&, ByteBuffer&&);
  16. int m_code { 0 };
  17. HashMap<String, String> m_headers;
  18. };