Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flags -G -d works incorrectly #53

Open
GoRunMaxim opened this issue Jun 27, 2022 · 0 comments
Open

Flags -G -d works incorrectly #53

GoRunMaxim opened this issue Jun 27, 2022 · 0 comments

Comments

@GoRunMaxim
Copy link

Are you requesting support for a new curl flag? If so, what is the flag and the equivalent Go code?

curl -G https://curl-to-go.com \
 -d "id=8a829417567d952801568d9d9e3c0b84" \
 -H "Authorization: Bearer OGE4Mjk0MTc1NjdkOTUyODAxNTY4ZDlkOWU5ZjBiODh8amF5MjdhdDVzMg=="
params := url.Values{
		"id": {"8a829417567d952801568d9d9e3c0b84"},
	}

	reqUrl := "https://curl-to-go.com?" + params.Encode()

	req, err := http.NewRequest(http.MethodGet, reqUrl, nil)
	if err != nil {
		// handle err
	}

	req.Header.Set("Authorization", "Bearer OGFjN2E0Yzc4MTZmYjJmNjAxODE2ZmRmMmFjMzAwYTJ8NVF4ZmtDcWZqSA==")

	resp, err := http.DefaultClient.Do(req)
	if err != nil {
		// handle err
	}
	defer resp.Body.Close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants