play.libs

## Class WS.WSWithEncoding

- java.lang.Object
- - play.libs.WS.WSWithEncoding

- Enclosing class:
    WS

      public static class WS.WSWithEncoding
      extends java.lang.Object

  Internal class exposing all the methods previously exposed by WS. This impl has information about encoding. When calling original static methods on WS, then a singleton of WSWithEncoding is called - configured with default encoding. This makes this encoding-enabling backward compatible

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `java.lang.String` | `encoding`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `WSWithEncoding(java.lang.String encoding)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.lang.String` | `encode(java.lang.String part)` URL-encode a string to be used as a query string parameter.
    `WS.WSRequest` | `url(java.lang.String url)` Build a WebService Request with the given URL.
    `WS.WSRequest` | `url(java.lang.String url, java.lang.String... params)` Build a WebService Request with the given URL.
    `WS.WSWithEncoding` | `withEncoding(java.lang.String newEncoding)` Use this method to get an instance to WS with different encoding

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### encoding

          public final java.lang.String encoding

  - ### Constructor Detail

    - #### WSWithEncoding

          public WSWithEncoding(java.lang.String encoding)

  - ### Method Detail

    - #### withEncoding

          public WS.WSWithEncoding withEncoding(java.lang.String newEncoding)

      Use this method to get an instance to WS with different encoding
      Parameters:
        `newEncoding` - the encoding to use in the communication
      Returns:
        a new instance of WS with specified encoding

    - #### encode

          public java.lang.String encode(java.lang.String part)

      URL-encode a string to be used as a query string parameter.
      Parameters:
        `part` - string to encode
      Returns:
        url-encoded string

    - #### url

          public WS.WSRequest url(java.lang.String url)

      Build a WebService Request with the given URL. This object support chaining style programming for adding params, file, headers to requests.
      Parameters:
        `url` - of the request
      Returns:
        a WSRequest on which you can add params, file headers using a chaining style programming.

    - #### url

          public WS.WSRequest url(java.lang.String url,
                                  java.lang.String... params)

      Build a WebService Request with the given URL. This constructor will format url using params passed in arguments. This object support chaining style programming for adding params, file, headers to requests.
      Parameters:
        `url` - to format using the given params.
        `params` - the params passed to format the URL.
      Returns:
        a WSRequest on which you can add params, file headers using a chaining style programming.

Guillaume Bort & zenexity - Distributed under Apache 2 licence, without any warrantly