Freelance Web Developer

Static Web Hosting, made easy

Mar 4, 2016

Simple REST API client in Go ( Google Go )

After writting many Golang REST APIs, I realised need of a REST API client to test these APIs. Becuase CURL commands are complex.

Here is the code

Here is an example use case for Go JSON REST API with mongoDb database

List all the Pandas

go run client.go -url= -method=get

Create new Panda

go run client.go -url= -method=post -data='{"Name":"Name of Panda"}'

Delete existing Panda

go run client.go -url={Id} -method=delete

Update existing Panda

go run client.go -url={Id} -method=put -data='{"Name":"New name"}'

Labels: ,

By :