Search Options

Results per page
Sort
Preferred Languages
Advance

Results 51 - 60 of 96 for contentTypes (0.33 sec)

  1. samples/guide/src/main/java/okhttp3/recipes/kt/PostStreaming.kt

    import okhttp3.RequestBody
    import okio.BufferedSink
    
    class PostStreaming {
      private val client = OkHttpClient()
    
      fun run() {
        val requestBody =
          object : RequestBody() {
            override fun contentType() = MEDIA_TYPE_MARKDOWN
    
            override fun writeTo(sink: BufferedSink) {
              sink.writeUtf8("Numbers\n")
              sink.writeUtf8("-------\n")
              for (i in 2..997) {
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 1.9K bytes
    - Viewed (0)
  2. cmd/event-notification.go

    		args.EventName == event.ObjectRemovedNoOP
    
    	if !isRemovedEvent {
    		newEvent.S3.Object.ETag = args.Object.ETag
    		newEvent.S3.Object.Size = args.Object.Size
    		newEvent.S3.Object.ContentType = args.Object.ContentType
    		newEvent.S3.Object.UserMetadata = make(map[string]string, len(args.Object.UserDefined))
    		for k, v := range args.Object.UserDefined {
    			if stringsHasPrefixFold(strings.ToLower(k), ReservedMetadataPrefixLower) {
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Thu Apr 04 12:04:40 GMT 2024
    - 7.8K bytes
    - Viewed (0)
  3. okhttp/src/test/java/okhttp3/internal/http/ThreadInterruptTest.kt

        server.start()
        val call =
          client.newCall(
            Request.Builder()
              .url(server.url("/"))
              .post(
                object : RequestBody() {
                  override fun contentType() = null
    
                  override fun writeTo(sink: BufferedSink) {
                    for (i in 0..9) {
                      sink.writeByte(0)
                      sink.flush()
                      sleep(100)
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 4.6K bytes
    - Viewed (0)
  4. okhttp-coroutines/src/test/kotlin/okhttp3/coroutines/ExecuteAsyncTest.kt

            .protocol(Protocol.HTTP_1_1)
            .message("OK")
            .code(200)
            .body(
              object : ResponseBody() {
                override fun contentType() = null
    
                override fun contentLength() = -1L
    
                override fun source() =
                  object : ForwardingSource(Buffer()) {
                    override fun close() {
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Thu Apr 18 01:24:38 GMT 2024
    - 5.4K bytes
    - Viewed (0)
  5. okhttp/src/test/java/okhttp3/KotlinSourceModernTest.kt

        val encodedName: String = formBody.encodedName(0)
        val name: String = formBody.name(0)
        val encodedValue: String = formBody.encodedValue(0)
        val value: String = formBody.value(0)
        val contentType: MediaType = formBody.contentType()
        val contentLength: Long = formBody.contentLength()
        formBody.writeTo(Buffer())
        val requestBody: RequestBody = formBody
      }
    
      @Test
      fun formBodyBuilder() {
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Apr 01 14:21:25 GMT 2024
    - 46.5K bytes
    - Viewed (4)
  6. okhttp/src/main/kotlin/okhttp3/MultipartReader.kt

        private var currentPart: PartSource? = null
    
        @Throws(IOException::class)
        constructor(response: ResponseBody) : this(
          source = response.source(),
          boundary =
            response.contentType()?.parameter("boundary")
              ?: throw ProtocolException("expected the Content-Type to have a boundary parameter"),
        )
    
        @Throws(IOException::class)
        fun nextPart(): Part? {
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 7.1K bytes
    - Viewed (0)
  7. okhttp/src/test/java/okhttp3/CallTest.kt

        server.enqueue(MockResponse())
    
        // Call 1: set a deadline on the request body.
        val requestBody1: RequestBody =
          object : RequestBody() {
            override fun contentType(): MediaType = "text/plain".toMediaType()
    
            override fun writeTo(sink: BufferedSink) {
              sink.writeUtf8("abc")
              sink.timeout().deadline(5, TimeUnit.SECONDS)
            }
          }
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Wed Apr 10 19:46:48 GMT 2024
    - 142.5K bytes
    - Viewed (0)
  8. okhttp-coroutines/src/test/kotlin/okhttp3/SuspendCallTest.kt

            .protocol(Protocol.HTTP_1_1)
            .message("OK")
            .code(200)
            .body(
              object : ResponseBody() {
                override fun contentType() = null
    
                override fun contentLength() = -1L
    
                override fun source() =
                  object : ForwardingSource(Buffer()) {
                    override fun close() {
    Plain Text
    - Registered: Fri Apr 12 11:42:09 GMT 2024
    - Last Modified: Fri Apr 05 11:25:23 GMT 2024
    - 5.3K bytes
    - Viewed (0)
  9. cmd/handler-utils.go

    		if err != nil {
    			return nil, err
    		}
    	}
    
    	// Set content-type to default value if it is not set.
    	if _, ok := metadata[strings.ToLower(xhttp.ContentType)]; !ok {
    		metadata[strings.ToLower(xhttp.ContentType)] = "binary/octet-stream"
    	}
    
    	// https://github.com/google/security-research/security/advisories/GHSA-76wf-9vgp-pj7w
    	for k := range metadata {
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Thu Apr 04 12:04:40 GMT 2024
    - 15.5K bytes
    - Viewed (3)
  10. okhttp/src/main/kotlin/okhttp3/FormBody.kt

      fun encodedValue(index: Int): String = encodedValues[index]
    
      fun value(index: Int): String = encodedValue(index).percentDecode(plusIsSpace = true)
    
      override fun contentType(): MediaType = CONTENT_TYPE
    
      override fun contentLength(): Long = writeOrCountBytes(null, true)
    
      @Throws(IOException::class)
      override fun writeTo(sink: BufferedSink) {
        writeOrCountBytes(sink, false)
      }
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Tue Jan 09 12:33:05 GMT 2024
    - 4.3K bytes
    - Viewed (0)
Back to top