example

command module
v0.0.0-...-4d67945 Latest Latest
Warning

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

Go to latest
Published: May 3, 2020 License: BSD-3-Clause Imports: 5 Imported by: 0

README

Form Decoder Example

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

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

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

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

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

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