gencurl icon indicating copy to clipboard operation
gencurl copied to clipboard

It is not support `--data-raw`

Open orestonce opened this issue 3 years ago • 1 comments

  • input
curl -X POST https://www.google.com --data-raw 'id=ae94cfbb-38b0-4b0c-bcff-2cb866a742fa'
  • expect output:

// Generated by curl-to-Go: https://mholt.github.io/curl-to-go
resp, err := http.Post("https://www.google.com", "", strings.NewReader("id=ae94cfbb-38b0-4b0c-bcff-2cb866a742fa"))
if err != nil {
	// handle err
}
defer resp.Body.Close()
  • current output:

// Generated by curl-to-Go: https://mholt.github.io/curl-to-go
resp, err := http.Post("https://www.google.com", "", nil)
if err != nil {
	// handle err
}
defer resp.Body.Close()

orestonce avatar Oct 21 '20 05:10 orestonce

Thanks for finding this. I'm, unfortunately, too busy to address this issue at this time. PRs are very welcome.

On Tue, Oct 20, 2020 at 11:30 PM orestonce [email protected] wrote:

  • input

curl -X POST https://www.google.com https://urldefense.com/v3/__https://www.google.com__;!!NCc8flgU!N_pXQN-I1lFtQOK8r3NBsXjMw5MbnHVb8IEZMc_DLsOrpCEr5I7vpuRa8fv0oPSRLg$ --data-raw 'id=ae94cfbb-38b0-4b0c-bcff-2cb866a742fa'

  • expect output:

// Generated by curl-to-Go: https://mholt.github.io/curl-to-go https://urldefense.com/v3/__https://mholt.github.io/curl-to-go__;!!NCc8flgU!N_pXQN-I1lFtQOK8r3NBsXjMw5MbnHVb8IEZMc_DLsOrpCEr5I7vpuRa8fvN3JSpeA$ resp, err := http.Post("https://www.google.com https://urldefense.com/v3/__https://www.google.com__;!!NCc8flgU!N_pXQN-I1lFtQOK8r3NBsXjMw5MbnHVb8IEZMc_DLsOrpCEr5I7vpuRa8fv0oPSRLg$", "", strings.NewReader("id=ae94cfbb-38b0-4b0c-bcff-2cb866a742fa")) if err != nil { // handle err } defer resp.Body.Close()

  • current output:

// Generated by curl-to-Go: https://mholt.github.io/curl-to-go https://urldefense.com/v3/__https://mholt.github.io/curl-to-go__;!!NCc8flgU!N_pXQN-I1lFtQOK8r3NBsXjMw5MbnHVb8IEZMc_DLsOrpCEr5I7vpuRa8fvN3JSpeA$ resp, err := http.Post("https://www.google.com https://urldefense.com/v3/__https://www.google.com__;!!NCc8flgU!N_pXQN-I1lFtQOK8r3NBsXjMw5MbnHVb8IEZMc_DLsOrpCEr5I7vpuRa8fv0oPSRLg$", "", nil) if err != nil { // handle err } defer resp.Body.Close()

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://urldefense.com/v3/__https://github.com/sethgrid/gencurl/issues/6__;!!NCc8flgU!N_pXQN-I1lFtQOK8r3NBsXjMw5MbnHVb8IEZMc_DLsOrpCEr5I7vpuRa8ftP0gg6mw$, or unsubscribe https://urldefense.com/v3/__https://github.com/notifications/unsubscribe-auth/AAHRU7HIYANTNLCT3IFQL6TSLZWW3ANCNFSM4SZIR42Q__;!!NCc8flgU!N_pXQN-I1lFtQOK8r3NBsXjMw5MbnHVb8IEZMc_DLsOrpCEr5I7vpuRa8fu8wR5nxw$ .

sethgrid avatar Oct 26 '20 16:10 sethgrid