default

command
v0.0.0-...-2897420 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2018 License: Apache-2.0 Imports: 8 Imported by: 0

README

Default API

This example makes use of the default micro API request handler.

The api expects you use the api.Request/Response protos.

The default micro api request handler gives you full control over the http request and response while still leveraging RPC and any transport plugins that use other protocols beyond http in your stack such as grpc, nats, kafka.

Usage

Run the micro API

micro api

Run this example

go run default.go

Make a GET request to /example/call which will call go.micro.api.example Example.Call

curl "http://localhost:8080/example/call?name=john"

Make a POST request to /example/foo/bar which will call go.micro.api.example Foo.Bar

curl -H 'Content-Type: application/json' -d '{}' http://localhost:8080/example/foo/bar

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
Package api is a generated protocol buffer package.
Package api is a generated protocol buffer package.

Jump to

Keyboard shortcuts

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