Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions .github/workflows/pythonapp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.7', '3.8', '3.9', '3.10']
python-version: ["3.7", "3.8", "3.9", "3.10"]

steps:
- uses: actions/checkout@v2
Expand All @@ -23,5 +23,3 @@ jobs:
run: make lint
- name: pytest
run: pytest --cov-report=xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
5 changes: 5 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
Changelog
---------

1.1.1
~~~~~

* Fix content-type is always json if json_encode_body is true (thanks @aenima-x).

1.1.0
~~~~~

Expand Down
9 changes: 1 addition & 8 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
Simple Rest Client
==================

|Github Actions Status| |Coverage Status| |Requirements Status|
|Code Climate|
|Github Actions Status|

----

Expand Down Expand Up @@ -36,9 +35,3 @@ Projects using

.. |Github Actions Status| image:: https://github.com/allisson/python-simple-rest-client/workflows/main-workflow/badge.svg
:target: https://github.com/allisson/python-simple-rest-client/actions
.. |Coverage Status| image:: https://codecov.io/gh/allisson/python-simple-rest-client/branch/master/graph/badge.svg
:target: https://codecov.io/gh/allisson/python-simple-rest-client
.. |Requirements Status| image:: https://requires.io/github/allisson/python-simple-rest-client/requirements.svg?branch=master
:target: https://requires.io/github/allisson/python-simple-rest-client/requirements/?branch=master
.. |Code Climate| image:: https://codeclimate.com/github/allisson/python-simple-rest-client/badges/gpa.svg
:target: https://codeclimate.com/github/allisson/python-simple-rest-client
3 changes: 0 additions & 3 deletions simple_rest_client/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@ def __init__(
self.ssl_verify = True if ssl_verify is None else ssl_verify
self._resources = {}

if self.json_encode_body:
self.headers["Content-Type"] = "application/json"

def add_resource(
self,
api_root_url=None,
Expand Down
2 changes: 1 addition & 1 deletion tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ def test_api_headers():
api = API(api_root_url="http://localhost:0/api/")
assert api.headers == {}

json_api = API(api_root_url="http://localhost:0/api/", json_encode_body=True)
json_api = API(api_root_url="http://localhost:0/api/", headers={"Content-Type": "application/json"})
assert json_api.headers == {"Content-Type": "application/json"}


Expand Down