Skip to content

Commit

Permalink
Merge pull request #11 from jacobrichard/master
Browse files Browse the repository at this point in the history
Completing HTTP methods
  • Loading branch information
steveniemitz committed Mar 28, 2017
2 parents f83fd7a + 1994623 commit 42c7f0c
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
21 changes: 21 additions & 0 deletions scales/http/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,27 @@ def Delete(self, url, **kwargs):
"""
pass

def Patch(self, url, **kwargs):
"""Issue an HTTP PATCH to url.
kwargs aligns with arguments to requests, although timeout is ignored.
"""
pass

def Head(self, url, **kwargs):
"""Issue an HTTP HEAD to url.
kwargs aligns with arguments to requests, although timeout is ignored.
"""
pass

def Options(self, url, **kwargs):
"""Issue an HTTP OPTIONS to url.
kwargs aligns with arguments to requests, although timeout is ignored.
"""
pass


class Http(object):
@staticmethod
Expand Down
6 changes: 6 additions & 0 deletions scales/http/sink.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,12 @@ def _MakeRequest(self, msg, stream, timeout):
response = self._session.put(url, **kwargs)
elif method == 'delete':
response = self._session.delete(url, **kwargs)
elif method == 'patch':
response = self._session.patch(url, **kwargs)
elif method == 'head':
response = self._session.head(url, **kwargs)
elif method == 'options':
response = self._session.options(url, **kwargs)
else:
raise NotImplementedError()
return response
Expand Down

0 comments on commit 42c7f0c

Please sign in to comment.