Standard library / net/http
http.ErrNotMultipart
Returned by MultipartReader when the request is not multipart/form-data or multipart/mixed. Expected stdout: 'true\n'.
Formal Syntax & Structure
go syntaxgo
var ErrNotMultipart *http.ProtocolErrorWorking Example
Example Snippetgo
package main
import ( "errors" "fmt" "net/http" "net/http/httptest")
func main() { r := httptest.NewRequest("POST", "/", nil) r.Header.Set("Content-Type", "text/plain") _, e := r.MultipartReader() fmt.Println(errors.Is(e, http.ErrNotMultipart))}
func must[T any](v T, e error) T { if e != nil { panic(e) } return v}func check(e error) { if e != nil { panic(e) }}