Skip to content

Commit f59f13b

Browse files
author
Ben Einaudi
committed
Add application/json in headers
1 parent 3b74237 commit f59f13b

File tree

6 files changed

+19
-11
lines changed

6 files changed

+19
-11
lines changed

README.rst

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
Cloudfoundry python client
22
==========================
33
.. image:: https://img.shields.io/pypi/v/cloudfoundry-client.svg
4-
:target: https://pypi.python.org/pypi/cloudfoundry-client
4+
:target: https://pypi.python.org/pypi/cloudfoundry-client
55
.. image:: https://img.shields.io/github/license/antechrestos/cf-python-client.svg
6-
:target: https://raw.githubusercontent.com/antechrestos/cf-python-client/master/LICENSE
6+
:target: https://raw.githubusercontent.com/antechrestos/cf-python-client/master/LICENSE
77

88
The cf-python-client repo contains a Python client library for Cloud Foundry.
99

@@ -14,7 +14,7 @@ From pip
1414
~~~~~~~~
1515
.. code-block:: bash
1616
17-
$ pip install cloudfoundry-client
17+
$ pip install cloudfoundry-client
1818
1919
From sources
2020
~~~~~~~~~~~~
@@ -23,7 +23,7 @@ To build the library run :
2323

2424
.. code-block:: bash
2525
26-
$ python setup.py install
26+
$ python setup.py install
2727
2828
2929
Run the client
@@ -32,7 +32,7 @@ To run the client, enter the following command :
3232

3333
.. code-block:: bash
3434
35-
$ cloudfoundry-client
35+
$ cloudfoundry-client
3636
3737
This will explains you how the client works. At first execution, it will ask you information about the platform you want to reach (url, login and so on).
3838
Please note that your credentials won't be saved on your disk: only tokens will be kept for further use.

integration/config_test.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import logging
22
import os
33

4-
from imported import ConfigParser, NoSectionError, NoOptionError
4+
from imported import ConfigParser, NoSectionError, NoOptionError, HTTPConnection
55
from cloudfoundry_client.client import CloudFoundryClient
66

77
_client = None
@@ -11,8 +11,12 @@
1111

1212

1313
def _init_logging():
14+
HTTPConnection.debuglevel = 1
1415
logging.basicConfig(level=logging.DEBUG,
1516
format='%(levelname)5s - %(name)s - %(message)s')
17+
requests_log = logging.getLogger("requests.packages.urllib3")
18+
requests_log.setLevel(logging.DEBUG)
19+
requests_log.propagate = True
1620

1721

1822
def get_resource_dir():

integration/imported.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
import sys
22

3-
43
if sys.version_info.major == 2:
54
from ConfigParser import ConfigParser, NoSectionError, NoOptionError
6-
from httplib import SEE_OTHER, CREATED, NO_CONTENT
5+
from httplib import SEE_OTHER, CREATED, NO_CONTENT,HTTPConnection
76

87
elif sys.version_info.major == 3:
98
from configparser import ConfigParser, NoSectionError, NoOptionError
10-
from http.client import SEE_OTHER, CREATED, NO_CONTENT
9+
from http.client import SEE_OTHER, CREATED, NO_CONTENT, HTTPConnection
1110
else:
1211
raise ImportError('Invalid major version: %d' % sys.version_info.major)

main/cloudfoundry_client/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
This module provides a client library for cloudfoundry_client v2.
33
"""
44

5-
__version__ = "0.0.21"
5+
__version__ = "0.0.22"

main/cloudfoundry_client/client.py

+5
Original file line numberDiff line numberDiff line change
@@ -73,3 +73,8 @@ def _is_token_expired(response):
7373
return False
7474
else:
7575
return False
76+
77+
@staticmethod
78+
def _token_request_headers(_):
79+
return dict(Accept='application/json')
80+

requirements.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
protobuf==2.6.1
2-
oauth2-client==0.0.15
2+
oauth2-client==0.0.21

0 commit comments

Comments
 (0)