Skip to content

Instantly share code, notes, and snippets.

@jbowens
Created October 7, 2014 20:48
Show Gist options
  • Save jbowens/72736271c5806e175b9c to your computer and use it in GitHub Desktop.
Save jbowens/72736271c5806e175b9c to your computer and use it in GitHub Desktop.
go proxy test
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