This commit is contained in:
edoardottt
2021-05-02 10:17:03 +02:00
parent f9502eb85b
commit a36654a7d6
+2 -1
View File
@@ -28,7 +28,8 @@ func GetRequest(target string) (string, error) {
//PostRequest performs a POST request and return
//a string (the body of the response)
//the map in the input should contains the data fields and values
//in this way for example: email: test@example.com, password: stupid_pwd
//in this way for example:
//{ email: test@example.com, password: stupid_pwd }
func PostRequest(target string, data map[string]string) (string, error) {
postBody, _ := json.Marshal(data)
responseBody := bytes.NewBuffer(postBody)