Now - Software Engineer @ G
Sometimes - Mua @ Boonmee Lab
Previous - Infra Engineer @ Rakuten
github.com/parnurzeal
or
www.parnurzeal.com
resp, err := http.Get("http://example.com/")
m := map[string]interface{}{
"name": "backy",
"species": "dog",
}
mJson, err := json.Marshal(m)
if err != nil {
panic(err)
}
contentReader := bytes.NewReader(mJson)
req, err := http.NewRequest("POST", "http://example.com", contentReader)
if err != nil {
panic(err)
}
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Notes", "GoRequest is coming!")
client := &http.Client{}
resp, err := client.Do(req)
(Things get more complicated.)
request
.post('http://example.com')
.send({ name: 'backy', species: 'dog' })
.set('Notes', 'Superagent is coming!')
.end(function(err, res){
if (err || !res.ok) {
alert('Oh no! error');
} else {
alert('yay got ' + JSON.stringify(res.body));
}
});
GoRequest to Rescue
m := map[string]interface{}{
"name": "backy",
"species": "dog",
}
mJson, err := json.Marshal(m)
if err != nil {
panic(err)
}
contentReader := bytes.NewReader(mJson)
req, err := http.NewRequest("POST", "http://example.com", contentReader)
if err != nil {
panic(err)
}
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Notes", "GoRequest is coming!")
client := &http.Client{}
resp, err := client.Do(req)
request := gorequest.New()
resp, body, errs := request.Post("http://example.com").
Set("Notes","gorequst is coming!").
Send(`{"name":"backy", "species":"dog"}`).
End()
iPhone6 launched!
iPhone Availability (Public JSON)
Go-reserve-iphone6
See Infra PPT
"gorequest just worked for me... couldn't be easier"
Now
771 stars, 99 forks, used by 77 packages
Good Meaningful Logo :P
Complaint is good, issue is great, PR is awesome!
Fb page: Happy the Scottie