vibe.d beta banner
get vibe.d
0.8.3

Asynchronous I/O that doesn’t get in your way, written in D

Class HTTPClientResponse

Represents a HTTP client response (as received from the server).

class HTTPClientResponse
  : HTTPResponse ;

Fields

NameTypeDescription
cookies Cookie[string]All cookies that shall be set on the client for this request
headers DictionaryList!(string,false,12L,false)The response header fields
httpVersion HTTPVersionThe protocol version of the response - should not be changed
statusCode intThe status code of the response, 200 by default
statusPhrase stringThe status phrase of the response

Properties

NameTypeDescription
bodyReader[get] vibe.internal.interfaceproxy.InterfaceProxy!(vibe.core.stream.InputStream)An input stream suitable for reading the response body.
maxRequests[get] intContains the keep-alive 'max' parameter, indicates how many requests a client can make before the server closes the connection.
contentType[get, set] stringShortcut to the "Content-Type" header

Methods

NameDescription
disconnect Forcefully terminates the connection regardless of the current state.
dropBody Reads and discards the response body.
readJson Reads the whole response body and tries to parse it as JSON.
readRawBody Provides unsafe means to read raw data from the connection.
switchProtocol Switches the connection to a new protocol and returns the resulting ConnectionStream.
toString
Authors

Sönke Ludwig, Jan Krüger

Copyright

© 2012-2014 RejectedSoftware e.K.

License

Subject to the terms of the MIT license, as written in the included LICENSE.txt file.