Fix FreeBSD build.
[haiku.git] / headers / os / net / HttpResult.h
blob9875f99d5be50479a2bd50c16c0c460c17a803ca
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_
9 #include <iostream>
11 #include <HttpHeaders.h>
12 #include <String.h>
13 #include <Url.h>
14 #include <UrlResult.h>
17 class BUrlRequest;
20 class BHttpResult: public BUrlResult {
21 friend class BHttpRequest;
23 public:
24 BHttpResult(const BUrl& url);
25 BHttpResult(BMessage*);
26 BHttpResult(const BHttpResult& other);
27 ~BHttpResult();
29 // Result parameters modifications
30 void SetUrl(const BUrl& url);
32 // Result parameters access
33 const BUrl& Url() const;
34 BString ContentType() const;
35 size_t Length() const;
37 // HTTP-Specific stuff
38 const BHttpHeaders& Headers() const;
39 const BString& StatusText() const;
40 int32 StatusCode() const;
42 // Result tests
43 bool HasHeaders() const;
45 // Overloaded members
46 BHttpResult& operator=(const BHttpResult& other);
48 virtual status_t Archive(BMessage*, bool) const;
49 static BArchivable* Instantiate(BMessage*);
50 private:
51 BUrl fUrl;
53 BHttpHeaders fHeaders;
54 int32 fStatusCode;
55 BString fStatusString;
59 #endif // _B_URL_RESULT_H_