5 ms·
Show HN: Convert Chrome-generated cURL Commands to Python Requests
- fiatjaf 12y agoThis is great, I've been wanting this tool for a long time now, and always thinking about building it myself. I'm happy, a little because I can use the tool, but much more because someone had the same problem as mine and come up with the same solution.
- cleverjake 12y agoYou should make a chrome extension to do this directly in the dropdown
- Timothee 12y agoThat's a great idea but I don't think that it can be done. I just checked the API doc and came across this post: https://groups.google.com/forum/m/#!msg/google-chrome-developer-tools/5rWuaXMfjwQ/l_LaGq4PGnsJ https://groups.google.com/forum/m/#!msg/google-chrome-develo... The post is from 2013 and the documentation doesn't clearly say that it's not possible, so there could be some hope... That being said, one could find some work-arounds to make something work even if not as nice as an item in the contextual menu. E.g. It looks like an extension can read and write the clipboard. Then you could have an action button that just converts the cURL command in the clipboard into the Requests one. Or, more agressively, poll the clipboard and replace any cURL into Requests... Right now, I can't think of a UX as good as a context menu in the networks panel: having an action button all the time just for that would seem like a waste of space, a DevTools tab as well, a context menu item only present if the clipboard is a cURL command would be fine because present only when needed however it'd be out of context...
- NickC_dev 12y agoGood find. The context menu is definitely the UX holy grail. Right now I'm probably not going to spend time on the clipboard approach, but it sounds workable. Going forward, I'll add support for node, maybe java. There are plenty of other languages out there that I'll take pull requests for!