类 Headers.Builder

java.lang.Object
com.lark.oapi.okhttp.Headers.Builder
封闭类:
Headers

public static final class Headers.Builder extends Object
  • 构造器详细资料

    • Builder

      public Builder()
  • 方法详细资料

    • add

      public Headers.Builder add(String line)
      Add an header line containing a field name, a literal colon, and a value.
    • add

      public Headers.Builder add(String name, String value)
      Add a header with the specified name and value. Does validation of header names and values.
    • addUnsafeNonAscii

      public Headers.Builder addUnsafeNonAscii(String name, String value)
      Add a header with the specified name and value. Does validation of header names, allowing non-ASCII values.
    • addAll

      public Headers.Builder addAll(Headers headers)
      Adds all headers from an existing collection.
    • add

      public Headers.Builder add(String name, Date value)
      Add a header with the specified name and formatted date. Does validation of header names and value.
    • add

      @IgnoreJRERequirement public Headers.Builder add(String name, Instant value)
      Add a header with the specified name and formatted instant. Does validation of header names and value.
    • set

      public Headers.Builder set(String name, Date value)
      Set a field with the specified date. If the field is not found, it is added. If the field is found, the existing values are replaced.
    • set

      @IgnoreJRERequirement public Headers.Builder set(String name, Instant value)
      Set a field with the specified instant. If the field is not found, it is added. If the field is found, the existing values are replaced.
    • removeAll

      public Headers.Builder removeAll(String name)
    • set

      public Headers.Builder set(String name, String value)
      Set a field with the specified value. If the field is not found, it is added. If the field is found, the existing values are replaced.
    • get

      @Nullable public String get(String name)
      Equivalent to build().get(name), but potentially faster.
    • build

      public Headers build()