Search code examples
regexcurlgeturl-encoding

Working with Curl to do get requests


This is one of those strange things that I could not find on the internet as hard as I tried to look.
I am working with curl to do some get requests to twitter and google and would like to know if curl has a way of simply encoding my strings to be url safe? If curl does not encode urls for me can some one point me to a regex script for encoding urls?


Solution

  • A program wget will encode an url including space or punctuations.

    $ wget 'http://www.example.com/123 456'
    --2011-06-28 15:46:02--  http://www.example.com/123%20456
    ...