Package com.castlabs.android.network

## Class UserAgent

- java.lang.Object
- - com.castlabs.android.network.UserAgent

-     public class UserAgent
      extends Object

  Instances of this class are used to construct the user agent that is used for HTTP requests. Additional key/value properties can be registered using `register(String, String)`. Since version 4.0.1 this class strips non-ASCII characters from the User-Agent by default. You can disable this behaviour by setting
  Since:
    3.0.0

- - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `static boolean` | `STRIP_NON_ASCII_CHARACTERS` | By default, the UserAgent string will be stripped and all non-ASCII characters will be removed.

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `UserAgent()` |

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `static void` | `register​(String key, String value)` | Register an additional key value pair that will be added to the user agent string representation
    `String` | `toString()` |

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

      `equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### STRIP_NON_ASCII_CHARACTERS

          public static boolean STRIP_NON_ASCII_CHARACTERS

      By default, the UserAgent string will be stripped and all non-ASCII characters will be removed. You can set this flag to `true` to disable the filter. Please note that some HTTP stacks, especially the one used by OkHttp do not allow non-ASCII characters in the User Agent and you will get an Exception if you change the behaviour.
      Since:
        4.0.1

  - ### Constructor Detail

    - #### UserAgent

          public UserAgent()

  - ### Method Detail

    - #### register

          public static void register​(@NonNull
                                      String key,
                                      @NonNull
                                      String value)

      Register an additional key value pair that will be added to the user agent string representation
      Parameters:
        `key` - the key
        `value` - the value

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`