POST /givememp
Content-Type: application/json
{"id": "my_id", "phone": 2345, "longtitude": "123.1123", "latitude", "323.231"}
200 OK
Content-Type: application/json
{"results": [...]}
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
// "bytes" | |
"code.google.com/p/go.crypto/openpgp" | |
"github.com/qiniu/log" | |
"io/ioutil" | |
"os" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10073 ~/tmp » curl -v -o /dev/null -H "Host: mxycforum.u.qiniudn.com" http://iovip.qbox.me/2014-07-22-af9ef033c73595ca9b260326fa19c6b6\?imageMogr/v2/auto-orient/thumbnail/750/ccffff | |
* Adding handle: conn: 0x7fe142804600 | |
* Adding handle: send: 0 | |
* Adding handle: recv: 0 | |
* Curl_addHandleToPipeline: length: 1 | |
* - Conn 0 (0x7fe142804600) send_pipe: 1, recv_pipe: 0 | |
% Total % Received % Xferd Average Speed Time Time Time Current | |
Dload Upload Total Spent Left Speed | |
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0* About to connect() to iovip.qbox.me port 80 (#0) | |
* Trying 183.136.139.17... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10012 ~/tmp » curl -v -o /dev/null http://mxycforum.u.qiniudn.com/2014-07-22-af9ef033c73595ca9b260326fa19c6b6\?imageMogr/v2/auto-orient/thumbnail/750/c | |
* Adding handle: conn: 0x7fe101004600 | |
* Adding handle: send: 0 | |
* Adding handle: recv: 0 | |
* Curl_addHandleToPipeline: length: 1 | |
* - Conn 0 (0x7fe101004600) send_pipe: 1, recv_pipe: 0 | |
% Total % Received % Xferd Average Speed Time Time Time Current | |
Dload Upload Total Spent Left Speed | |
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0* About to connect() to mxycforum.u.qiniudn.com port 80 (#0) | |
* Trying 180.153.176.136... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//http://play.golang.org/p/nRZP1YHQaB | |
package main | |
import "fmt" | |
import "strconv" | |
func main() { | |
fmt.Println("Hello, playground") | |
itbl := 435746972 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"runtime/debug" | |
"time" | |
) | |
func main() { | |
m := int64(1024*1024) * 100 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"net" | |
) | |
func main() { | |
ln, err := net.Listen("tcp", ":8080") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"math/rand" | |
"strings" | |
"time" | |
) | |
var ( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func SetTimeout(client *Client, t int) (err error) { | |
timeout := time.Duration(t) * time.Second | |
dialTimeout := func(network, addr string) (net.Conn, error) { | |
return net.DialTimeout(network, addr, timeout) | |
} | |
if client.Transport == nil { | |
client.Transport = &http.Transport{ | |
Dial: dialTimeout, |