Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package main
- import (
- "fmt"
- "io"
- "io/ioutil"
- "net/http"
- "os/user"
- "strings"
- )
- func main() {
- URL := "http://localhost:8080/"
- u, _ := user.Current()
- content := strings.NewReader(fmt.Sprintf("%+v", u))
- resp, err := http.Post(URL, "text", content)
- if err != nil {
- return
- }
- io.Copy(ioutil.Discard, resp.Body)
- resp.Body.Close()
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement