uk.co.bigbeeconsultants.http

HttpBrowser

class HttpBrowser extends Http

Provides an alternative to uk.co.bigbeeconsultants.http.HttpClient in which every request carries an outbound cookie jar and every inbound response potentially provides a modified cookie jar. A series of requests will therefore behave like a normal web-browser by aggregating cookies from the server and returning them back in subsequent requests.

Automatic authentication is also supported.

Concurrent requests with an instance of this class are permitted. But when concurrent requests are made, note that there may be race conditions that may or may not cause some cookie updates to be overwritten, depending on the server behaviour. Cookie jars themselves are immutable so will be in either of two states: the original state or the updated state.

Linear Supertypes
Http, HttpExecutor, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. HttpBrowser
  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 HttpBrowser(commonConfig: Config = ..., initialCookieJar: CookieJar = header.CookieJar.Empty, credentialSuite: CredentialSuite = auth.CredentialSuite.Empty, cacheConfig: CacheConfig = ...)

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 cookies: CookieJar

    Gets the current state of the cookie jar.

    Gets the current state of the cookie jar. If multiple threads are executing, this will return a snapshot of the state at some instant.

  9. 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] )
  10. 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] )
  11. final def eq(arg0: AnyRef): Boolean

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

    Definition Classes
    AnyRef → Any
  13. 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
    HttpBrowserHttpExecutor
    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

  14. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  15. 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] )
  16. 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] )
  17. final def getClass(): Class[_]

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

    Definition Classes
    AnyRef → Any
  19. 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] )
  20. 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] )
  21. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  22. 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

  23. 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

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

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

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

    Definition Classes
    AnyRef
  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