Closed shandygunawan closed 3 years ago
Hi @shandygunawan, thanks for the kind words!
Can you make some examples so I can think a bit more about it?
Hello. Here are some examples I can think of:
const curlSnippet = CurlGenerator(params, {"silent": true, "show-error": true})
// curlSnippet => curl "https://jsonplaceholder.typicode.com/posts" -X POST -H "Content-type: application/json; charset=UTF-8" -d "{\"id\":\"123-456-789\",\"key1\":\"value 1\",\"key2\":\"a \\\"complex\\\" value\"}" -s -S
const curlSnippet = CurlGenerator(params, {"output": "output.txt" })
// curlSnippet => curl "https://jsonplaceholder.typicode.com/posts" -X POST -H "Content-type: application/json; charset=UTF-8" -d "{\"id\":\"123-456-789\",\"key1\":\"value 1\",\"key2\":\"a \\\"complex\\\" value\"}" -o output.txt
No need to support all of the options of course haha, maybe the most used ones.
Thanks for your time @shandygunawan. That looks like a nice addition, I'll check for options that sounds reasonable to have and add them.
Released with 0.2.0
Hi there! Nice work!
Thank you so much for making this. It's a life saver.
Though there are one problem that I encountered: There is seems no way to add curl options in the CurlGenerator so I have to add it manually by concatenating the string output.
So I think it would be nice to have one.
Once again, thank you so much for making this.
Cheers.