1/* 2 * Copyright 2010-2017 Haiku Inc. All rights reserved. 3 * Distributed under the terms of the MIT License. 4 */ 5#ifndef _B_HTTP_RESULT_H_ 6#define _B_HTTP_RESULT_H_ 7 8 9#include <HttpHeaders.h> 10#include <String.h> 11#include <Url.h> 12#include <UrlResult.h> 13 14 15namespace BPrivate { 16 17namespace Network { 18 19 20class BUrlRequest; 21 22 23class BHttpResult: public BUrlResult { 24 friend class BHttpRequest; 25 26public: 27 BHttpResult(const BUrl& url); 28 BHttpResult(const BHttpResult& other); 29 ~BHttpResult(); 30 31 // Result parameters modifications 32 void SetUrl(const BUrl& url); 33 34 // Result parameters access 35 const BUrl& Url() const; 36 BString ContentType() const; 37 off_t Length() const; 38 39 // HTTP-Specific stuff 40 const BHttpHeaders& Headers() const; 41 const BString& StatusText() const; 42 int32 StatusCode() const; 43 44 // Result tests 45 bool HasHeaders() const; 46 47 // Overloaded members 48 BHttpResult& operator=(const BHttpResult& other); 49 50private: 51 BUrl fUrl; 52 53 BHttpHeaders fHeaders; 54 int32 fStatusCode; 55 BString fStatusString; 56}; 57 58 59} // namespace Network 60 61} // namespace BPrivate 62 63#endif // _B_URL_RESULT_H_ 64