uk.co.bigbeeconsultants.http

HttpClient

class HttpClient extends Http

Constructs an instance for handling any number of HTTP requests with any level of concurrency.

Using this class, cookies must be managed programmatically. If you provide cookie jars, the responses will include cookie jars,which may or may not have been altered by the server. If you do not provide cookie jars, none will come back either.

uk.co.bigbeeconsultants.http.HttpBrowser provides an alternative that handles cookies for you.

Linear Supertypes
Http, HttpExecutor, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. HttpClient
  2. Http
  3. HttpExecutor
  4. AnyRef
  5. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new HttpClient(commonConfig: Config = ...)

Value Members

  1. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  7. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  8. def delete(url: URL, requestHeaders: Headers, jar: CookieJar): Response

    Make a DELETE request with cookies.

    Make a DELETE request with cookies.

    Definition Classes
    Http
    Annotations
    @throws( classOf[IOException] )
  9. def delete(url: URL, requestHeaders: Headers = Nil): Response

    Make a DELETE request.

    Make a DELETE request. No cookies are used and none are returned.

    Definition Classes
    Http
    Annotations
    @throws( classOf[IOException] )
  10. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  11. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  12. def execute(request: Request, responseBuilder: ResponseBuilder, config: Config = commonConfig): Unit

    Makes an arbitrary request using a response builder.

    Makes an arbitrary request using a response builder. After this call, the response builder will provide the response.

    request

    the request

    responseBuilder

    the response factory, e.g. new BufferedResponseBuilder

    config

    the particular configuration being used for this request; defaults to the commonConfiguration supplied to this instance of HttpClient

    Definition Classes
    HttpClientHttpExecutor
    Annotations
    @throws( classOf[IOException] ) @throws( classOf[IllegalStateException] )
    Exceptions thrown
    IOException

    (or ConnectException subclass) if an IO exception occurred

    IllegalStateException

    if the maximum redirects threshold was exceeded

  13. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  14. def get(url: URL, requestHeaders: Headers, jar: CookieJar): Response

    Make a GET request with cookies.

    Make a GET request with cookies.

    Definition Classes
    Http
    Annotations
    @throws( classOf[IOException] )
  15. def get(url: URL, requestHeaders: Headers = Nil): Response

    Make a GET request.

    Make a GET request. No cookies are used and none are returned.

    Definition Classes
    Http
    Annotations
    @throws( classOf[IOException] )
  16. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  17. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  18. def head(url: URL, requestHeaders: Headers, jar: CookieJar): Response

    Make a HEAD request with cookies.

    Make a HEAD request with cookies.

    Definition Classes
    Http
    Annotations
    @throws( classOf[IOException] )
  19. def head(url: URL, requestHeaders: Headers = Nil): Response

    Make a HEAD request.

    Make a HEAD request. No cookies are used and none are returned.

    Definition Classes
    Http
    Annotations
    @throws( classOf[IOException] )
  20. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  21. def makeRequest(request: Request, config: Config = commonConfig): Response

    Makes an arbitrary request and returns the response, which contains the entire response body in a buffer.

    Makes an arbitrary request and returns the response, which contains the entire response body in a buffer. All the convenience methods (head, get, put, post, trace, options) use this buffered method.

    It is the 'normal' way to make HTTP requests. Bit it may be inappropriate when the response body is too large to be buffered in memory, or if it is desirable to start processing the body whilst it is still being read in, in which case use 'makeUnbufferedRequest' instead.

    request

    the request

    config

    the particular configuration being used for this request; defaults to the commonConfiguration supplied to this instance of HttpClient

    returns

    the response (for all outcomes including 4xx and 5xx status codes) if no exception occurred

    Definition Classes
    Http
    Annotations
    @throws( classOf[IOException] )
    Exceptions thrown
    IOException

    (or ConnectException subclass) if an IO exception occurred

  22. def makeUnbufferedRequest(request: Request, config: Config = commonConfig): Response

    Makes an arbitrary request and returns a the response.

    Makes an arbitrary request and returns a the response. For successful 200-OK responses, this will be an *unbuffered* response with direct access to the source input stream. This allows bespoke usage of this stream. It is the caller's responsibility to ensure that the stream is always closed, so preventing leakage of resources. This is made easier because the stream is of a kind that will automatically close as soon as all the data has been read.

    For all responses other than 200-OK, a buffered response is returned, as if makeRequest had been used instead. This ensures that the input stream is automatically closed for all error, redirection and no-content responses.

    request

    the request

    config

    the particular configuration being used for this request; defaults to the commonConfiguration supplied to this instance of HttpClient

    returns

    the response (for all outcomes including 4xx and 5xx status codes) if no exception occurred

    Definition Classes
    Http
    Annotations
    @throws( classOf[IOException] )
    Exceptions thrown
    IOException

    (or ConnectException subclass) if an IO exception occurred

  23. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  24. final def notify(): Unit

    Definition Classes
    AnyRef
  25. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  26. def openConnection(request: Request, proxy: Option[Proxy]): HttpURLConnection

    Provides a seam for testing.

    Provides a seam for testing. Not for normal use.

    Attributes
    protected
    Annotations
    @throws( classOf[IOException] )
  27. def options(url: URL, body: Option[RequestBody], requestHeaders: Headers, jar: CookieJar): Response

    Make an OPTIONS request with cookies.

    Make an OPTIONS request with cookies.

    Definition Classes
    Http
    Annotations
    @throws( classOf[IOException] )
  28. def options(url: URL, body: Option[RequestBody], requestHeaders: Headers = Nil): Response

    Make an OPTIONS request.

    Make an OPTIONS request. No cookies are used and none are returned.

    Definition Classes
    Http
    Annotations
    @throws( classOf[IOException] )
  29. def post(url: URL, body: Option[RequestBody], requestHeaders: Headers, jar: CookieJar): Response

    Make a POST request with cookies.

    Make a POST request with cookies.

    Definition Classes
    Http
    Annotations
    @throws( classOf[IOException] )
  30. def post(url: URL, body: Option[RequestBody], requestHeaders: Headers = Nil): Response

    Make a POST request.

    Make a POST request. No cookies are used and none are returned.

    Definition Classes
    Http
    Annotations
    @throws( classOf[IOException] )
  31. def put(url: URL, body: RequestBody, requestHeaders: Headers, jar: CookieJar): Response

    Make a PUT request with cookies.

    Make a PUT request with cookies.

    Definition Classes
    Http
    Annotations
    @throws( classOf[IOException] )
  32. def put(url: URL, body: RequestBody, requestHeaders: Headers = Nil): Response

    Make a PUT request.

    Make a PUT request. No cookies are used and none are returned.

    Definition Classes
    Http
    Annotations
    @throws( classOf[IOException] )
  33. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  34. def toString(): String

    Definition Classes
    AnyRef → Any
  35. def trace(url: URL, requestHeaders: Headers, jar: CookieJar): Response

    Make a TRACE request with cookies.

    Make a TRACE request with cookies.

    Definition Classes
    Http
    Annotations
    @throws( classOf[IOException] )
  36. def trace(url: URL, requestHeaders: Headers = Nil): Response

    Make a TRACE request.

    Make a TRACE request. No cookies are used and none are returned.

    Definition Classes
    Http
    Annotations
    @throws( classOf[IOException] )
  37. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws()
  38. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws()
  39. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws()

Inherited from Http

Inherited from HttpExecutor

Inherited from AnyRef

Inherited from Any

Ungrouped