Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 22 for NewRequest (0.18 sec)

  1. okhttp/src/test/java/okhttp3/DispatcherTest.kt

        client.newWebSocket(newRequest("http://a/3"), webSocketListener)
        executor.assertJobs("http://a/1", "http://a/2", "http://a/3")
      }
    
      @Test
      fun increasingMaxRequestsPromotesJobsImmediately() {
        dispatcher.maxRequests = 2
        client.newCall(newRequest("http://a/1")).enqueue(callback)
        client.newCall(newRequest("http://b/1")).enqueue(callback)
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Fri Apr 05 03:30:42 GMT 2024
    - 12.7K bytes
    - Viewed (0)
  2. okhttp/src/test/java/okhttp3/URLConnectionTest.kt

        server.enqueue(response)
        assertContent("ABCDEFGHIJKLMNOPQR", getResponse(newRequest("/foo")))
        assertThat(server.takeRequest().sequenceNumber).isEqualTo(0)
        assertContent("ABCDEFGHIJKLMNOPQR", getResponse(newRequest("/bar?baz=quux")))
        assertThat(server.takeRequest().sequenceNumber).isEqualTo(1)
        assertContent("ABCDEFGHIJKLMNOPQR", getResponse(newRequest("/z")))
        assertThat(server.takeRequest().sequenceNumber).isEqualTo(2)
      }
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sat Jan 20 10:30:28 GMT 2024
    - 131.7K bytes
    - Viewed (0)
  3. cmd/signature-v4-utils_test.go

    	}
    
    	for i, testCase := range testCases {
    		// creating an input HTTP request.
    		// Only the headers are relevant for this particular test.
    		inputReq, err := http.NewRequest(http.MethodGet, "http://example.com", nil)
    		if err != nil {
    			t.Fatalf("Error initializing input HTTP request: %v", err)
    		}
    		if testCase.inputQueryKey != "" {
    			q := inputReq.URL.Query()
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Fri Apr 05 21:26:41 GMT 2024
    - 14.3K bytes
    - Viewed (0)
  4. samples/compare/src/test/kotlin/okhttp3/compare/JettyHttpClientTest.kt

      }
    
      @AfterEach fun tearDown() {
        client.stop()
      }
    
      @Test fun get(server: MockWebServer) {
        server.enqueue(MockResponse(body = "hello, Jetty HTTP Client"))
    
        val request =
          client.newRequest(server.url("/").toUri())
            .header("Accept", "text/plain")
        val response = request.send()
        assertThat(response.status).isEqualTo(200)
        assertThat(response.contentAsString).isEqualTo("hello, Jetty HTTP Client")
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 2K bytes
    - Viewed (0)
  5. internal/grid/handlers.go

    func (h *SingleHandler[Req, Resp]) NewResponse() Resp {
    	return h.newResp()
    }
    
    // NewRequest creates a new request.
    // Handlers can use this to create a reusable request.
    // The request may be reused, so caller should clear any fields.
    func (h *SingleHandler[Req, Resp]) NewRequest() Req {
    	return h.newReq()
    }
    
    // Register a handler for a Req -> Resp roundtrip.
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Tue Apr 23 17:15:52 GMT 2024
    - 27.1K bytes
    - Viewed (0)
  6. internal/rest/client.go

    func removeEmptyPort(host string) string {
    	if hasPort(host) {
    		return strings.TrimSuffix(host, ":")
    	}
    	return host
    }
    
    // Copied from http.NewRequest but implemented to ensure we reuse `url.URL` instance.
    func (c *Client) newRequest(ctx context.Context, u url.URL, body io.Reader) (*http.Request, error) {
    	rc, ok := body.(io.ReadCloser)
    	if !ok && body != nil {
    		rc = io.NopCloser(body)
    	}
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Sun Apr 28 17:53:50 GMT 2024
    - 14.4K bytes
    - Viewed (0)
  7. internal/config/policy/plugin/config.go

    	Transport   http.RoundTripper     `json:"-"`
    	CloseRespFn func(r io.ReadCloser) `json:"-"`
    }
    
    // Validate - validate opa configuration params.
    func (a *Args) Validate() error {
    	req, err := http.NewRequest(http.MethodPost, a.URL.String(), bytes.NewReader([]byte("")))
    	if err != nil {
    		return err
    	}
    
    	req.Header.Set("Content-Type", "application/json")
    	if a.AuthToken != "" {
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Thu Sep 14 21:50:16 GMT 2023
    - 5.8K bytes
    - Viewed (0)
  8. internal/config/policy/opa/config.go

    	Transport   http.RoundTripper     `json:"-"`
    	CloseRespFn func(r io.ReadCloser) `json:"-"`
    }
    
    // Validate - validate opa configuration params.
    func (a *Args) Validate() error {
    	req, err := http.NewRequest(http.MethodPost, a.URL.String(), bytes.NewReader([]byte("")))
    	if err != nil {
    		return err
    	}
    
    	req.Header.Set("Content-Type", "application/json")
    	if a.AuthToken != "" {
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Thu Sep 14 21:50:16 GMT 2023
    - 5.2K bytes
    - Viewed (1)
  9. okhttp/src/main/kotlin/okhttp3/Cache.kt

         * Returns true if none of the Vary headers have changed between [cachedRequest] and
         * [newRequest].
         */
        fun varyMatches(
          cachedResponse: Response,
          cachedRequest: Headers,
          newRequest: Request,
        ): Boolean {
          return cachedResponse.headers.varyFields().none {
            cachedRequest.values(it) != newRequest.headers(it)
          }
        }
    
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Wed Apr 10 19:46:48 GMT 2024
    - 26.8K bytes
    - Viewed (0)
  10. internal/config/lambda/target/webhook.go

    		}
    	}()
    
    	if err = target.init(); err != nil {
    		return nil, err
    	}
    
    	data, err := json.Marshal(eventData)
    	if err != nil {
    		return nil, err
    	}
    
    	req, err := http.NewRequest(http.MethodPost, target.args.Endpoint.String(), bytes.NewReader(data))
    	if err != nil {
    		return nil, err
    	}
    
    	// Verify if the authToken already contains
    	// <Key> <Token> like format, if this is
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Fri Nov 17 20:02:26 GMT 2023
    - 6.7K bytes
    - Viewed (0)
Back to top