2 * Copyright 2010 Haiku Inc. All rights reserved.
3 * Distributed under the terms of the MIT License.
6 * Christophe Huriaux, c.huriaux@gmail.com
10 #include <HttpResult.h>
17 BHttpResult::BHttpResult(const BUrl
& url
)
26 BHttpResult::BHttpResult(const BHttpResult
& other
)
29 fHeaders(other
.fHeaders
),
30 fStatusCode(other
.fStatusCode
),
31 fStatusString(other
.fStatusString
)
36 BHttpResult::~BHttpResult()
41 // #pragma mark Result parameters modifications
45 BHttpResult::SetUrl(const BUrl
& url
)
51 // #pragma mark Result parameters access
55 BHttpResult::Url() const
62 BHttpResult::ContentType() const
64 return Headers()["Content-Type"];
69 BHttpResult::Length() const
71 const char* length
= Headers()["Content-Length"];
79 BHttpResult::Headers() const
86 BHttpResult::StatusCode() const
93 BHttpResult::StatusText() const
99 // #pragma mark Result tests
103 BHttpResult::HasHeaders() const
105 return fHeaders
.CountHeaders() > 0;
109 // #pragma mark Overloaded members
113 BHttpResult::operator=(const BHttpResult
& other
)
119 fHeaders
= other
.fHeaders
;
120 fStatusCode
= other
.fStatusCode
;
121 fStatusString
= other
.fStatusString
;