Search Options

Results per page
Sort
Preferred Languages
Advance

Results 31 - 40 of 139 for type (0.25 sec)

  1. okhttp-tls/src/main/kotlin/okhttp3/tls/internal/der/DerWriter.kt

          }
        }
    
        // Write the payload.
        sink.writeAll(content)
      }
    
      /**
       * Execute [block] with a new namespace for type hints. Type hints from the enclosing type are no
       * longer usable by the current type's members.
       */
      fun <T> withTypeHint(block: () -> T): T {
        typeHintStack.add(null)
        try {
          return block()
        } finally {
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 5.7K bytes
    - Viewed (0)
  2. okhttp-dnsoverhttps/src/main/kotlin/okhttp3/dnsoverhttps/DnsOverHttps.kt

        val failures = ArrayList<Exception>(2)
        val results = ArrayList<InetAddress>(5)
    
        buildRequest(hostname, networkRequests, results, failures, DnsRecordCodec.TYPE_A)
    
        if (includeIPv6) {
          buildRequest(hostname, networkRequests, results, failures, DnsRecordCodec.TYPE_AAAA)
        }
    
        executeRequests(hostname, networkRequests, results, failures)
    
        return results.ifEmpty {
          throwBestFailure(hostname, failures)
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Fri Mar 22 07:09:21 GMT 2024
    - 9.8K bytes
    - Viewed (0)
  3. docs/recipes.md

                .post(postBody.toRequestBody(MEDIA_TYPE_MARKDOWN))
                .build()
    
            client.newCall(request).execute().use { response ->
              if (!response.isSuccessful) throw IOException("Unexpected code $response")
    
              println(response.body!!.string())
            }
          }
    
          companion object {
            val MEDIA_TYPE_MARKDOWN = "text/x-markdown; charset=utf-8".toMediaType()
          }
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Fri Feb 18 08:52:22 GMT 2022
    - 40.2K bytes
    - Viewed (1)
  4. samples/guide/src/main/java/okhttp3/recipes/kt/PostFile.kt

            body = file.asRequestBody(MEDIA_TYPE_MARKDOWN),
          )
    
        client.newCall(request).execute().use { response ->
          if (!response.isSuccessful) throw IOException("Unexpected code $response")
    
          println(response.body.string())
        }
      }
    
      companion object {
        val MEDIA_TYPE_MARKDOWN = "text/x-markdown; charset=utf-8".toMediaType()
      }
    }
    
    fun main() {
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 1.4K bytes
    - Viewed (0)
  5. samples/guide/src/main/java/okhttp3/recipes/kt/PostString.kt

            body = postBody.toRequestBody(MEDIA_TYPE_MARKDOWN),
          )
    
        client.newCall(request).execute().use { response ->
          if (!response.isSuccessful) throw IOException("Unexpected code $response")
    
          println(response.body.string())
        }
      }
    
      companion object {
        val MEDIA_TYPE_MARKDOWN = "text/x-markdown; charset=utf-8".toMediaType()
      }
    }
    
    fun main() {
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 1.6K bytes
    - Viewed (0)
  6. samples/guide/src/main/java/okhttp3/recipes/PostString.java

    import okhttp3.MediaType;
    import okhttp3.OkHttpClient;
    import okhttp3.Request;
    import okhttp3.RequestBody;
    import okhttp3.Response;
    
    public final class PostString {
      public static final MediaType MEDIA_TYPE_MARKDOWN
          = MediaType.get("text/x-markdown; charset=utf-8");
    
      private final OkHttpClient client = new OkHttpClient();
    
      public void run() throws Exception {
        String postBody = ""
            + "Releases\n"
    Java
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sat May 25 18:02:55 GMT 2019
    - 1.7K bytes
    - Viewed (0)
  7. samples/guide/src/main/java/okhttp3/recipes/kt/PostMultipart.kt

            .setType(MultipartBody.FORM)
            .addFormDataPart("title", "Square Logo")
            .addFormDataPart(
              "image",
              "logo-square.png",
              File("docs/images/logo-square.png").asRequestBody(MEDIA_TYPE_PNG),
            )
            .build()
    
        val request =
          Request.Builder()
            .header("Authorization", "Client-ID $IMGUR_CLIENT_ID")
            .url("https://api.imgur.com/3/image")
            .post(requestBody)
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 2.1K bytes
    - Viewed (0)
  8. mockwebserver/src/test/java/mockwebserver3/internal/http2/Http2Server.kt

        stream: Http2Stream,
        path: String,
      ) {
        val responseHeaders =
          listOf(
            Header(":status", "404"),
            Header(":version", "HTTP/1.1"),
            Header("content-type", "text/plain"),
          )
        stream.writeHeaders(
          responseHeaders = responseHeaders,
          outFinished = false,
          flushHeaders = false,
        )
        val out = stream.getSink().buffer()
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 6.1K bytes
    - Viewed (0)
  9. okhttp/src/test/java/okhttp3/MediaTypeTest.kt

        assertEquals("!#$%&'*+-.{|}~", mediaType.type)
        assertEquals("!#$%&'*+-.{|}~", mediaType.subtype)
      }
    
      @Test fun testCharsetIsOneOfManyParameters() {
        val mediaType = parse("text/plain;a=1;b=2;charset=utf-8;c=3")
        assertEquals("text", mediaType.type)
        assertEquals("plain", mediaType.subtype)
        assertEquals("UTF-8", mediaType.charsetName())
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 7.5K bytes
    - Viewed (0)
  10. okhttp/src/main/kotlin/okhttp3/internal/http/BridgeInterceptor.kt

        val requestBuilder = userRequest.newBuilder()
    
        val body = userRequest.body
        if (body != null) {
          val contentType = body.contentType()
          if (contentType != null) {
            requestBuilder.header("Content-Type", contentType.toString())
          }
    
          val contentLength = body.contentLength()
          if (contentLength != -1L) {
            requestBuilder.header("Content-Length", contentLength.toString())
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 4.2K bytes
    - Viewed (2)
Back to top