Giter Club home page Giter Club logo

hammock's People

Contributors

kadirpekel avatar maraujop avatar rubik avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hammock's Issues

Requests 2.0 support

I haven't delved into the code, but there is a some kind of incompatibility with new requests.

Traceback (most recent call last):
  File "/Users/prophet/projects/djangodash2013/gopython3/api/tests.py", line 34, in test_wrapper_parses_data_correct
    data = self.api_wrapper.ask_about_package_info(name=self.package_name)
  File "/Users/prophet/projects/djangodash2013/gopython3/api/abstract_wrappers.py", line 33, in make_request_with_kwargs
    response = getattr(self.hammock, request_method)(**request_kwargs)
  File "/Users/prophet/.envs/djangodash2013/lib/python3.3/site-packages/hammock.py", line 107, in aux
    return hammock._request(method, *args, **kwargs)
  File "/Users/prophet/.envs/djangodash2013/lib/python3.3/site-packages/hammock.py", line 100, in _request
    return self._session.request(method, self._url(*args), **kwargs)
  File "/Users/prophet/.envs/djangodash2013/lib/python3.3/site-packages/requests/sessions.py", line 330, in request
    env_proxies = get_environ_proxies(url) or {}
  File "/Users/prophet/.envs/djangodash2013/lib/python3.3/site-packages/requests/utils.py", line 419, in get_environ_proxies
    if proxy_bypass(netloc):
  File "/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/urllib/request.py", line 2476, in proxy_bypass
    return proxy_bypass_macosx_sysconf(host)
  File "/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/urllib/request.py", line 2460, in proxy_bypass_macosx_sysconf
    return _proxy_bypass_macosx_sysconf(host, proxy_settings)
  File "/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/urllib/request.py", line 2434, in _proxy_bypass_macosx_sysconf
    hostIP = ip2num(hostIP)
  File "/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/urllib/request.py", line 2413, in ip2num
    parts = list(map(int, parts))
ValueError: invalid literal for int() with base 10: 'pypi'

Hammock seems to suffer from redirect HTTP verb change (via requests)

It seems that redirects will change the HTTP verb used for a request, thus breaking RESTful interaction.
For example an app that redirects http to https will transform a myapi.fragment.POST() to a myapi.fragment.GET()

This is discussed here: http://stackoverflow.com/questions/20475552/python-requests-library-redirect-new-url

Solution:

  • Disable redirects (allow_redirects=False)
  • Quietly rebuild the request if the response is an HTTP 302 with the url provided from the server.

Endpoints with characters that are not allowed in Python

I've run into an endpoint with a hyphen (-) in it, which wraps api.website/end-point/?querystring=xxxx into website.end-point('?querystring=xxxx').GET() and I'm getting errors when I try to access it that way.

This character is completely valid in the REST documentation. I assume there are others, but this is the one that I came across. I didn't see anything that handles this type of case in the source.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.