Lines Matching refs:URL
23 "net/url"
76 r, err := c.Get(ts.URL)
97 r, err := cst.c.Head(cst.ts.URL)
120 url := "http://dummy.faketld/"
121 client.Get(url) // Note: doesn't hit network
125 if tr.req.URL.String() != url {
126 t.Errorf("expected URL %q; got %q", url, tr.req.URL.String())
138 url := "http://dummy.faketld/"
141 client.Post(url, "application/json", b) // Note: doesn't hit network
146 if tr.req.URL.String() != url {
147 t.Errorf("got URL %q, want %q", tr.req.URL.String(), url)
166 form := make(url.Values)
175 if tr.req.URL.String() != urlStr {
176 t.Errorf("got URL %q, want %q", tr.req.URL.String(), urlStr)
210 if g, e := r.Referer(), ts.URL+"/?n=6"; e != g {
223 _, err := c.Get(ts.URL)
229 _, err = c.Head(ts.URL)
235 greq, _ := NewRequest("GET", ts.URL, nil)
256 res, err := c.Get(ts.URL)
261 finalUrl := res.Request.URL.String()
266 t.Errorf("expected final url to end in /?n=15; got url %q", finalUrl)
273 creq, _ := NewRequest("HEAD", ts.URL, nil)
287 res, err = c.Get(ts.URL)
288 if urlError, ok := err.(*url.Error); !ok || urlError.Err != checkErr {
289 t.Errorf("with redirects forbidden, expected a *url.Error with our 'no redirects allowed' error inside; got %#v (%q)", err, err)
320 req, _ := NewRequest("GET", ts.URL, nil)
323 ue, ok := err.(*url.Error)
325 t.Fatalf("got error %T; want *url.Error", err)
328 t.Errorf("url.Error.Err = %v; want %v", ue.Err, context.Canceled)
432 urlQuery := r.URL.Query()
434 location := ts.URL
455 req, _ := NewRequest(method, ts.URL+tt.suffix, strings.NewReader(content))
501 if strings.Contains(r.URL.Path, "/other") {
504 w.Header().Set("Location", ts.URL+"/other")
518 res, err := c.Get(ts.URL)
546 res, err := c.Get(ts.URL)
569 req, err := NewRequest("POST", ts.URL, strings.NewReader("some body"))
598 if r.URL.Path == "/" {
613 u, _ := url.Parse(us)
625 client.PostForm(us, url.Values{}) // Note: doesn't hit network
637 // Just enough correctness for our redirect tests. Uses the URL.Host as the
644 func (j *TestJar) SetCookies(u *url.URL, cookies []*Cookie) {
653 func (j *TestJar) Cookies(u *url.URL) []*Cookie {
667 u, _ := url.Parse(ts.URL)
669 resp, err := c.Get(ts.URL)
742 func (j *RecordingJar) SetCookies(u *url.URL, cookies []*Cookie) {
746 func (j *RecordingJar) Cookies(u *url.URL) []*Cookie {
773 res, err := c.Get(cst.ts.URL)
828 _, err := c.Get(ts.URL)
837 _, err = c.PostForm(ts.URL, url.Values{"foo": {"bar"}})
864 res, err := c.Get(ts.URL)
910 if _, err := c.Get(ts.URL); err != nil {
924 _, err := c.Get(ts.URL)
1005 _, err := Get(strings.Replace(ts.URL, "http", "https", 1))
1037 req, _ := NewRequest("HEAD", cst.ts.URL+tt.suffix, nil)
1077 req, err := NewRequest("GET", ts.URL, nil)
1081 req.URL.User = url.User(gopher)
1095 url := "http://My%20User:My%20Pass@dummy.faketld/"
1097 client.Get(url)
1102 if tr.req.URL.String() != url {
1103 t.Errorf("got URL %q, want %q", tr.req.URL.String(), url)
1129 // If Authorization header is provided, username in URL should not override it
1130 url := "http://My%20User@dummy.faketld/"
1131 req, err := NewRequest("GET", url, nil)
1142 if tr.req.URL.String() != url {
1143 t.Errorf("got URL %q, want %q", tr.req.URL.String(), url)
1176 if r.URL.Path == "/" {
1181 if r.URL.Path == "/slow" {
1197 URL)
1268 res, err := cst.c.Get(cst.ts.URL)
1273 if _, ok := err.(*url.Error); !ok {
1274 t.Fatalf("Got error of type %T; want *url.Error", err)
1305 req, _ := NewRequest("GET", cst.ts.URL, nil)
1326 if r.URL.Path == "/" {
1332 res, err := cst.c.Get(cst.ts.URL)
1391 l, err := url.Parse(tt.lastReq)
1395 n, err := url.Parse(tt.newReq)
1454 Redirect(w, r, ts1.URL, StatusFound)
1457 ts2URL = ts2.URL
1472 req, _ := NewRequest("GET", ts2.URL, nil)
1494 t.Errorf("Virtual host received request %v", r.URL)
1499 virtualHost := strings.TrimPrefix(virtual.URL, "http://")
1507 switch r.URL.Path {
1535 t.Errorf("Serving unexpected path %q", r.URL.Path)
1540 tsURL = ts.URL
1541 tsHost = strings.TrimPrefix(ts.URL, "http://")
1545 req, _ := NewRequest("GET", ts.URL, nil)
1632 u, _ := url.Parse(ts.URL)
1633 req, _ := NewRequest("GET", ts.URL, nil)
1680 u0, err := url.Parse(tt.initialURL)
1682 t.Errorf("%d. initial URL %q parse error: %v", i, tt.initialURL, err)
1685 u1, err := url.Parse(tt.destURL)
1687 t.Errorf("%d. dest URL %q parse error: %v", i, tt.destURL, err)
1755 w.Header().Set("Location", ts.URL)
1759 req, err := NewRequest(tt.method, ts.URL, nil)
1810 if r.URL.Path == "/ping" {
1824 res, err := c.Get(ts.URL + "/ping")
1835 req, err := NewRequest("POST", ts.URL, body)