Settings

Theme

Show HN: Convert Chrome-generated cURL Commands to Python Requests

curl.trillworks.com

27 points by NickC_dev 11 years ago · 4 comments

Reader

fiatjaf 11 years ago

This 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 11 years ago

You should make a chrome extension to do this directly in the dropdown

  • Timothee 11 years ago

    That'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-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_devOP 11 years ago

      Good 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!

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection