Created
October 7, 2014 20:48
-
-
Save jbowens/72736271c5806e175b9c to your computer and use it in GitHub Desktop.
go proxy test
This file contains hidden or 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/http" | |
"strings" | |
) | |
const testUrl = "http://respondto.it/jackson-proxy-test" | |
const testPayload = "hello world" | |
func main() { | |
fmt.Printf("Sending request to %s...\n", testUrl) | |
client := http.Client{} | |
req, err := http.NewRequest("POST", testUrl, strings.NewReader(testPayload)) | |
if err != nil { | |
panic(err) | |
} | |
resp, err := client.Do(req) | |
if err != nil { | |
panic(err) | |
} | |
fmt.Printf("Response: %+v", resp) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment