Skip to content

Commit

Permalink
simplify code
Browse files Browse the repository at this point in the history
  • Loading branch information
alaingilbert committed Aug 14, 2022
1 parent b740c4f commit 8dda27a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion gameforge.go
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,8 @@ func StartCaptchaChallenge(client IHttpClient, ctx context.Context, challengeID

func SolveChallenge(client IHttpClient, ctx context.Context, challengeID string, answer int64) error {
challengeURL := "https://image-drop-challenge.gameforge.com/challenge/" + challengeID + "/en-GB"
req, _ := http.NewRequest(http.MethodPost, challengeURL, strings.NewReader(`{"answer":`+strconv.FormatInt(answer, 10)+`}`))
body := strings.NewReader(`{"answer":` + strconv.FormatInt(answer, 10) + `}`)
req, _ := http.NewRequest(http.MethodPost, challengeURL, body)
req.Header.Set("Content-Type", "application/json")
req.WithContext(ctx)
resp, err := client.Do(req)
Expand Down

0 comments on commit 8dda27a

Please sign in to comment.