package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "http://localhost:3000/user/sign_up"
payload := strings.NewReader("user_name=blub&email=blub%40bla.bla&password=dsklfjaskjfKAKLJSAKDJ1827.&retype=dsklfjaskjfKAKLJSAKDJ1827.")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("cookie", "lang=en-US; i_like_gitea=8e2779a79e7d3e28; _csrf=uBwdvQ2EKSS69kVzPIGOPI1OmoU6MTU5NDMxMTk2NzA1ODIxMjgzNw")
req.Header.Add("content-type", "application/x-www-form-urlencoded")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
or a simple curl
curl --request POST \
--url http://localhost:3000/user/sign_up \
--header 'content-type: application/x-www-form-urlencoded' \
--cookie 'lang=en-US; i_like_gitea=8e2779a79e7d3e28; _csrf=uBwdvQ2EKSS69kVzPIGOPI1OmoU6MTU5NDMxMTk2NzA1ODIxMjgzNw' \
--data user_name=blub \
--data email=blub@bla.bla \
--data password=dsklfjaskjfKAKLJSAKDJ1827. \
--data retype=dsklfjaskjfKAKLJSAKDJ1827.
and as @techknowlogick said, the first user is always the admin.