Skip to content

kiancchen/unirest-go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Unirest-Go

A Golang http client with unirest-java styled interfaces. It encapsulates the native net/http library to provide simplified interfaces.

Example

response, err := New().SetURL("https://www.google.com").
									 AppendPath("/search").
									 AddQuery("q","unirest").Send().AsString() // or AsBytes()

Add other request parameters

  • AddHeader
  • AddFormField
  • AddFile
  • SetJSONBody
  • SetRawBody
  • SetBasicAuth

HTTP method

To make it simplified, it automatically chooses to use GET or POST method, depending whether you send parameters in the body. If you want to do it manually, you can call methods Get or Post. More request methods will be provided in the future.

Get native http request instance

Use ParseRequest method to produce a native http request after adding parameters.

Turn off auto clone

To make the client can be reused, it will clone the client instance every time you change it. You can use AutoClone(false) to turn off it or set true to turn on it. And you can use Clone to make clone manually.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages