add encoding section

This commit is contained in:
Asim Aslam 2017-01-01 19:20:53 +00:00 committed by Vasiliy Tolstov
parent 8934ef9162
commit e9fc51e4da

View File

@ -43,4 +43,16 @@ response := new(proto.Response)
err := client.Call(context.TODO(), request, response) err := client.Call(context.TODO(), request, response)
``` ```
### Encoding
Default protobuf with content-type application/proto
```go
client.NewRequest("service", "/path", protoRequest{})
```
Json with content-type application/json
```go
client.NewJsonRequest("service", "/path", jsonRequest{})
```
Look at http_test.go for detailed use. Look at http_test.go for detailed use.