Skip to content

Instantly share code, notes, and snippets.

@JanDeDobbeleer
Created March 20, 2018 09:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JanDeDobbeleer/bd0d7ea6d08b8a90422c5ff8bd8794bc to your computer and use it in GitHub Desktop.
Save JanDeDobbeleer/bd0d7ea6d08b8a90422c5ff8bd8794bc to your computer and use it in GitHub Desktop.
Break the egg
package main
import (
"fmt"
"io/ioutil"
"net/http"
"net/url"
"strings"
)
func main() {
for {
run()
}
}
func run() {
v := url.Values{}
v.Set("clicks", "50")
s := v.Encode()
req, err := http.NewRequest("POST", "http://playground.mnm.be/peterpaaseiei/ajax/breaktheegg.php", strings.NewReader(s))
if err != nil {
fmt.Printf("Error: %v\n", err)
return
}
req.Header.Add("Content-Type", "application/x-www-form-urlencoded")
c := &http.Client{}
resp, err := c.Do(req)
if err != nil {
fmt.Printf("Error: %v\n", err)
return
}
defer resp.Body.Close()
data, err := ioutil.ReadAll(resp.Body)
if err != nil {
fmt.Printf("Error: %v\n", err)
return
}
fmt.Println(string(data))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment