Skip to content

syhlion/greq

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

79 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

restful web service client

Go Report Card Build Status

restful web service reqeust tool

Requirements

Install

go get github.com/syhlion/greq

Usage

func main(){

    //need import https://github.com/syhlion/requestwork.v2
    worker:=requestwork.New(50)
    debug:=true

    client:=greq.New(worker,15*time.Second,debug)

    //GET
    data,httpstatus,err:=client.Get("https://tw.yahoo.com",nil)

    //POST
    v := url.Values{}
    v.Add("data", string(data))
    data,httpstatus,err:=client.Post("https://tw.yahoo.com",bytes.NewBufferString(v.Encode()))

}