form

command
Version: v0.0.0-...-f1d4689 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 22, 2020 License: MIT Imports: 3 Imported by: 0

README

Form Decoder Example

$ go run form/main.go
$ curl -XPOST \
-d "username=foo&password=bar" \
http://localhost:8080/login
username: foo, password: bar

$ curl -XPOST \
-H "Content-Type: application/json" \
-d '{"username":"foo", "password": "bar"}' \
    http://localhost:8080/login
username: foo, password: bar

$ curl -XPOST \
-H "Content-Type: application/xml" \
-d '<xml><username>foo</username><password>bar</password></xml>' \
    http://localhost:8080/login
username: foo, password: bar

$ curl -XPOST \
-F "username=foo" -F "password=bar" \
    http://localhost:8080/login
username: foo, password: bar

Documentation

The Go Gopher

There is no documentation for this package.

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL