Standard library / net/http

http.ErrMissingBoundary

Returned by MultipartReader when the multipart media type has no boundary. Expected stdout: 'true\n'.

Formal Syntax & Structure

go syntaxgo
var ErrMissingBoundary *http.ProtocolError

Working 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", "multipart/form-data")  _, e := r.MultipartReader()  fmt.Println(errors.Is(e, http.ErrMissingBoundary))}
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)  }}
Go Reference