Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Raw params data send #35

Merged
merged 1 commit into from Mar 4, 2014
Merged

Conversation

nwlunatic
Copy link
Contributor

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.

@@ -1113,7 +1128,7 @@ def fail_callback(request, errno, errmsg, async_client, opener):
self.assertTrue(isinstance(async_client, AsyncClient))
self.assertEquals(async_client, async_client_global)
self.assertEquals(errno, 6)
self.assertEquals(errmsg, "Couldn't resolve host '{0}'".format(request.url[7:]))
self.assertEquals(errmsg, "Could not resolve host: {0}".format(request.url[7:]))
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately this message generated by pycurl/libcurl and tests in travis is failed: https://travis-ci.org/Lispython/human_curl/jobs/19965736#L301

$ curl fwbefrubfbrfybghbfb4gbyvrv.com curl: (6) Couldn't resolve host 'fwbefrubfbrfybghbfb4gbyvrv.com'
or you have another behaviour?

@nwlunatic
Copy link
Contributor Author

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

To answer your questions:

  • fixed {} to {0} for python2.6
  • fixed "Could not resolve host: {0}" to "Couldn't resolve host '{0}'"

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 added a commit that referenced this pull request Mar 4, 2014
@Lispython Lispython merged commit 4d3109d into Lispython:master Mar 4, 2014
@Lispython
Copy link
Owner

Thanks.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants