Lispython / human_curl

Simple Human wrapper for cURL library
http://h.wrttn.me/human_curl
Other
205 stars 43 forks source link

Raw params data send #35

Closed nwlunatic closed 10 years ago

nwlunatic commented 10 years ago

Sometimes it's necessary to have ability to send raw parameters with get request. (especially in testing)

By default there going to be no changes, except fix: for parameters that were going in url, like, http://h.wrttn.me?key=value, key and value weren't encoded but now they are, look in tests.

For send a raw request, without url encoding, just need to pass a encode_url=True arg to Request.

nwlunatic commented 10 years ago

Sorry for comments, I've fixuped commits to prettify pull request.

To answer your questions:

Things about libcurl:

from travis build log:

$ pip install -U pycurl2
Downloading/unpacking pycurl2
  Downloading pycurl2-7.20.0.tar.gz (133kB): 133kB downloaded
  Running setup.py (path:/home/travis/virtualenv/python2.6/build/pycurl2/setup.py) egg_info for package pycurl2
  Using curl-config (libcurl 7.22.0)

while on my machine (ubuntu 13.10) build log says:

venv/bin/pip install -U pycurl2
Downloading/unpacking pycurl2
  Downloading pycurl2-7.20.0.tar.gz (133kB): 133kB downloaded
  Running setup.py egg_info for package pycurl2
    Using curl-config (libcurl 7.32.0)

so I have a

$ curl jgkasdocdofvjsdpoap.com
curl: (6) Could not resolve host: jgkasdocdofvjsdpoap.com

and that the difference between libcurl 7.22.0 and libcurl 7.32.0

Lispython commented 10 years ago

Thanks.

I think we can format resolve error string depend of pycurl2.version_info()