httprest 0.4.1__tar.gz → 0.4.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: httprest
3
- Version: 0.4.1
3
+ Version: 0.4.2
4
4
  Summary: A library for making simple REST-like HTTP requests
5
5
  License: MIT
6
6
  License-File: LICENSE
@@ -24,7 +24,7 @@ Classifier: Programming Language :: Python :: Implementation :: CPython
24
24
  Classifier: Topic :: Software Development :: Libraries
25
25
  Classifier: Topic :: Utilities
26
26
  Provides-Extra: requests-client
27
- Requires-Dist: requests (>=2.32.3,<3.0.0) ; extra == "requests-client"
27
+ Requires-Dist: requests (>=2,<3) ; extra == "requests-client"
28
28
  Project-URL: Repository, https://github.com/litteratum/httprest
29
29
  Description-Content-Type: text/markdown
30
30
 
@@ -26,7 +26,7 @@ class API:
26
26
  :param http_client: HTTP client to use for making HTTP requests.
27
27
  If not provided, the default one will be used
28
28
  """
29
- self._base_url = base_url.rstrip("/")
29
+ self._base_url = base_url.rstrip("/") + "/"
30
30
  self._http_client = http_client or _UrllibHTTPClient()
31
31
 
32
32
  def _request(
@@ -59,7 +59,9 @@ class API:
59
59
  )
60
60
 
61
61
  def _build_url(self, endpoint: _Optional[str]) -> str:
62
- return urllib.parse.urljoin(self._base_url, endpoint)
62
+ return urllib.parse.urljoin(
63
+ self._base_url, endpoint.lstrip("/") if endpoint else ""
64
+ )
63
65
 
64
66
  def __str__(self) -> str:
65
67
  return f"{self.__class__.__name__}(base_url='{self._base_url}')"
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "httprest"
3
- version = "0.4.1"
3
+ version = "0.4.2"
4
4
  description = "A library for making simple REST-like HTTP requests"
5
5
  authors = ["Andrii Nechaiev <andrewnech@gmail.com>"]
6
6
  readme = "README.md"
@@ -27,7 +27,7 @@ classifiers=[
27
27
 
28
28
  [tool.poetry.dependencies]
29
29
  python = "^3.9"
30
- requests = {version = "^2.32.3", optional = true}
30
+ requests = {version = "^2", optional = true}
31
31
 
32
32
  [tool.poetry.extras]
33
33
  requests-client = ["requests"]
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes