from Hacker News

Convert Curl Commands to Code

by mikecarlton on 1/29/24, 2:47 PM with 5 comments

  • by pimlottc on 1/29/24, 7:48 PM

    To threadjack a bit - is there a good tool to /minimize/ a curl command? E.g. when you copy a request from your browser's developer mode, it's a giant command line with every single header and option. But most of them aren't strictly necessary.

    Rather than stripping them out by hand and manually checking to see if the request still works, it would be nice to have a tool that helped automate this. Obviously it wouldn't work for every site but it would be very helpful.

  • by mikecarlton on 1/29/24, 3:25 PM

    Genius indeed, found it in comments on https://news.ycombinator.com/item?id=39175873
  • by m0d0nne11 on 1/29/24, 9:09 PM

    SEE ALSO: curl --libcurl
  • by cranberryturkey on 1/29/24, 2:51 PM

    this is genius! good job