Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 8 of 8 for FormDataContentType (0.48 sec)

  1. src/mime/multipart/writer.go

    				continue
    			}
    		}
    		return errors.New("mime: invalid boundary character")
    	}
    	w.boundary = boundary
    	return nil
    }
    
    // FormDataContentType returns the Content-Type for an HTTP
    // multipart/form-data with this [Writer]'s Boundary.
    func (w *Writer) FormDataContentType() string {
    	b := w.boundary
    	// We must quote the boundary if it contains any of the
    	// tspecials characters defined by RFC 2045, or space.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 4.9K bytes
    - Viewed (0)
  2. internal/config/subnet/subnet.go

    		return "", e
    	}
    	writer.Close()
    
    	r, e := http.NewRequest(http.MethodPost, reqURL, &body)
    	if e != nil {
    		return "", e
    	}
    	r.Header.Add("Content-Type", writer.FormDataContentType())
    
    	return c.submitPost(r)
    }
    
    func (c Config) submitPost(r *http.Request) (string, error) {
    	configLock.RLock()
    	r.Header.Set(xhttp.SubnetAPIKey, c.APIKey)
    	configLock.RUnlock()
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Mon Feb 27 16:35:36 UTC 2023
    - 2.9K bytes
    - Viewed (0)
  3. src/mime/multipart/writer_test.go

    		} else if tt.ok {
    			got := w.Boundary()
    			if got != tt.b {
    				t.Errorf("boundary = %q; want %q", got, tt.b)
    			}
    
    			ct := w.FormDataContentType()
    			mt, params, err := mime.ParseMediaType(ct)
    			if err != nil {
    				t.Errorf("could not parse Content-Type %q: %v", ct, err)
    			} else if mt != "multipart/form-data" {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Sep 06 17:36:47 UTC 2022
    - 4.1K bytes
    - Viewed (0)
  4. cmd/post-policy_test.go

    	req, err := http.NewRequest(http.MethodPost, makeTestTargetURL(endPoint, bucketName, "", nil), reader)
    	if err != nil {
    		return nil, err
    	}
    
    	// Set form content-type.
    	req.Header.Set("Content-Type", w.FormDataContentType())
    	return req, nil
    }
    
    func buildGenericPolicy(t time.Time, accessKey, region, bucketName, objectName string, contentLengthRange bool) []byte {
    	// Expire the request five minutes from now.
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Wed May 22 23:07:14 UTC 2024
    - 30.2K bytes
    - Viewed (0)
  5. src/net/http/request_test.go

    		t.Fatal(err)
    	}
    	if err := mw.Close(); err != nil {
    		t.Fatal(err)
    	}
    	req, err := NewRequest("POST", cst.URL, fBuf)
    	if err != nil {
    		t.Fatal(err)
    	}
    	req.Header.Set("Content-Type", mw.FormDataContentType())
    	res, err := cst.Client().Do(req)
    	if err != nil {
    		t.Fatal(err)
    	}
    	res.Body.Close()
    	if g, w := res.StatusCode, StatusOK; g != w {
    		t.Fatalf("Status code mismatch: got %d, want %d", g, w)
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 16 18:42:34 UTC 2024
    - 44K bytes
    - Viewed (0)
  6. src/net/http/serve_test.go

    	}
    	if err := mw.Close(); err != nil {
    		t.Fatal(err)
    	}
    	req, err := NewRequest("POST", cst.ts.URL, fBuf)
    	if err != nil {
    		t.Fatal(err)
    	}
    	req.Header.Set("Content-Type", mw.FormDataContentType())
    	res, err := cst.c.Do(req)
    	if err != nil {
    		t.Fatal(err)
    	}
    	defer res.Body.Close()
    	fname, err := io.ReadAll(res.Body)
    	if err != nil {
    		t.Fatal(err)
    	}
    	cst.close()
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Jun 07 17:57:01 UTC 2024
    - 202K bytes
    - Viewed (0)
  7. src/cmd/vendor/golang.org/x/tools/internal/stdlib/manifest.go

    		{"(*Writer).Close", Method, 0},
    		{"(*Writer).CreateFormField", Method, 0},
    		{"(*Writer).CreateFormFile", Method, 0},
    		{"(*Writer).CreatePart", Method, 0},
    		{"(*Writer).FormDataContentType", Method, 0},
    		{"(*Writer).SetBoundary", Method, 1},
    		{"(*Writer).WriteField", Method, 0},
    		{"ErrMessageTooLarge", Var, 9},
    		{"File", Type, 0},
    		{"FileHeader", Type, 0},
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Apr 02 02:20:05 UTC 2024
    - 534.2K bytes
    - Viewed (0)
  8. api/go1.txt

    pkg mime/multipart, method (*Writer) CreateFormFile(string, string) (io.Writer, error)
    pkg mime/multipart, method (*Writer) CreatePart(textproto.MIMEHeader) (io.Writer, error)
    pkg mime/multipart, method (*Writer) FormDataContentType() string
    pkg mime/multipart, method (*Writer) WriteField(string, string) error
    pkg mime/multipart, type File interface { Close, Read, ReadAt, Seek }
    pkg mime/multipart, type File interface, Close() error
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Aug 14 18:58:28 UTC 2013
    - 1.7M bytes
    - Viewed (0)
Back to top