- Sort Score
- Result 10 results
- Languages All
Results 11 - 20 of 220 for httpHost (0.16 sec)
-
src/net/http/httptest/example_test.go
package httptest_test import ( "fmt" "io" "log" "net/http" "net/http/httptest" ) func ExampleResponseRecorder() { handler := func(w http.ResponseWriter, r *http.Request) { io.WriteString(w, "<html><body>Hello World!</body></html>") } req := httptest.NewRequest("GET", "http://example.com/foo", nil) w := httptest.NewRecorder() handler(w, req) resp := w.Result() body, _ := io.ReadAll(resp.Body)
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue Oct 20 18:41:18 UTC 2020 - 2K bytes - Viewed (0) -
platforms/software/resources-http/src/main/java/org/gradle/internal/resource/transport/http/AlwaysFollowAndPreserveMethodRedirectStrategy.java
if (method.equalsIgnoreCase(HttpHead.METHOD_NAME)) { return new HttpHead(uri); } else if (method.equalsIgnoreCase(HttpPost.METHOD_NAME)) { return this.copyEntity(new HttpPost(uri), request); } else if (method.equalsIgnoreCase(HttpPut.METHOD_NAME)) { return this.copyEntity(new HttpPut(uri), request);
Registered: Wed Jun 12 18:38:38 UTC 2024 - Last Modified: Thu Oct 12 19:38:08 UTC 2023 - 3.1K bytes - Viewed (0) -
testing/smoke-test/src/smokeTest/groovy/org/gradle/play/integtest/fixtures/external/RunningPlayApp.groovy
} if (standalone) { httpPort = regexParseHttpPortStandalone(output.call(), occurrence) } else { httpPort = regexParseHttpPortFromGradle(output.call(), occurrence) } return httpPort } static int regexParseHttpPortStandalone(output, int occurrence) {
Registered: Wed Jun 12 18:38:38 UTC 2024 - Last Modified: Thu Apr 04 07:21:38 UTC 2024 - 3.9K bytes - Viewed (0) -
pilot/cmd/pilot-agent/status/testserver/server.go
package testserver import ( "net" "net/http" "net/http/httptest" ) // CreateAndStartServer starts a server and returns the response passed. func CreateAndStartServer(response string) *httptest.Server { return createHTTPServer(createDefaultFuncMap(response)) } func createHTTPServer(handlers map[string]func(rw http.ResponseWriter, _ *http.Request)) *httptest.Server { mux := http.NewServeMux() for k, v := range handlers {
Registered: Fri Jun 14 15:00:06 UTC 2024 - Last Modified: Wed Jan 26 17:53:14 UTC 2022 - 1.7K bytes - Viewed (0) -
src/net/http/pprof/testdata/delta_mutex.go
"net/http" "net/http/pprof" "net/http/httptest" "runtime" ) func main() { // Disable the mutex profiler. This is the default, but that default is // load-bearing for this test, which needs the base profile to be empty. runtime.SetMutexProfileFraction(0) h := pprof.Handler("mutex") req := httptest.NewRequest("GET", "/debug/pprof/mutex?seconds=1", nil) rec := httptest.NewRecorder() rec.Body = new(bytes.Buffer)
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu Dec 07 19:52:28 UTC 2023 - 1.2K bytes - Viewed (0) -
src/cmd/go/internal/vcweb/vcstest/vcstest.go
"encoding/pem" "fmt" "internal/testenv" "io" "log" "net/http" "net/http/httptest" "net/url" "os" "path/filepath" "testing" ) var Hosts = []string{ "vcs-test.golang.org", } type Server struct { vcweb *vcweb.Server workDir string HTTP *httptest.Server HTTPS *httptest.Server } // NewServer returns a new test-local vcweb server that serves VCS requests
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue Oct 25 13:44:48 UTC 2022 - 3.8K bytes - Viewed (0) -
samples/jwt-server/src/main.go
func NewJwtServer(certificate string, key string) *JWTServer { return &JWTServer{ httpPort: make(chan int, 1), httpsPort: make(chan int, 1), serverCertificate: certificate, serverPrivateKey: key, } } func main() { flag.Parse() s := NewJwtServer(*serverCert, *serverkey) go s.runHTTP(fmt.Sprintf(":%s", *httpPort)) if s.serverCertificate != "" && s.serverPrivateKey != "" {
Registered: Fri Jun 14 15:00:06 UTC 2024 - Last Modified: Fri Feb 16 23:56:50 UTC 2024 - 4.4K bytes - Viewed (0) -
staging/src/k8s.io/apimachinery/pkg/util/httpstream/spdy/roundtripper_test.go
io.Copy(stream, stream) } } type serverFunc func(http.Handler) *httptest.Server func httpsServerInvalidHostname(t *testing.T) serverFunc { return func(h http.Handler) *httptest.Server { cert, err := tls.X509KeyPair(exampleCert, exampleKey) if err != nil { t.Errorf("https (invalid hostname): proxy_test: %v", err) } ts := httptest.NewUnstartedServer(h) ts.TLS = &tls.Config{
Registered: Sat Jun 15 01:39:40 UTC 2024 - Last Modified: Mon Oct 23 22:33:38 UTC 2023 - 32.7K bytes - Viewed (0) -
src/net/http/httputil/example_test.go
// license that can be found in the LICENSE file. package httputil_test import ( "fmt" "io" "log" "net/http" "net/http/httptest" "net/http/httputil" "net/url" "strings" ) func ExampleDumpRequest() { ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { dump, err := httputil.DumpRequest(r, true) if err != nil {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue Aug 16 20:01:36 UTC 2022 - 3.2K bytes - Viewed (0) -
src/cmd/go/internal/vcweb/vcweb_test.go
package vcweb_test import ( "cmd/go/internal/vcweb" "io" "log" "net/http" "net/http/httptest" "os" "testing" ) func TestHelp(t *testing.T) { s, err := vcweb.NewServer(os.DevNull, t.TempDir(), log.Default()) if err != nil { t.Fatal(err) } srv := httptest.NewServer(s) defer srv.Close() resp, err := http.Get(srv.URL + "/help") if err != nil { t.Fatal(err) }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue Oct 25 13:00:34 UTC 2022 - 1.1K bytes - Viewed (0)