Skip to content

Commit 4f30214

Browse files
requests implemented in stack
1 parent 87986ae commit 4f30214

File tree

6 files changed

+11
-22
lines changed

6 files changed

+11
-22
lines changed

content/__init__.py

Whitespace-only changes.

content/test_functions.py

Lines changed: 0 additions & 11 deletions
This file was deleted.

contentstack/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
from .errors import HTTPError, ConfigError
1111
from .group import Group
1212
from .http_request import HTTPRequestConnection
13-
from .stack import Stack
1413

1514
__author__ = 'contentstack - (www.github.con/contentstack)'
1615
__email__ = 'shailesh.mishra@contentstack.com'

contentstack/http_request.py

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,11 @@ def __init__(self, url_path, query=dict, local_headers=dict):
1515
self.url_path = config.Config().get_endpoint(self.url_path)
1616

1717
def http_request(self) -> dict:
18+
1819
self._local_headers['X-User-Agent'] = self._contentstack_user_agent()
1920
self._local_headers['Content-Type'] = 'application/json'
20-
# print('_query_prams', self._query_prams)
21-
# print('url_endpoint', self.url_path)
22-
# print('Please wait we are fetching {0} response'.format(self.url_path))
23-
response = requests.get(
24-
self.url_path, params=self._query_prams,
25-
headers=self._local_headers,
26-
)
27-
28-
print(response.url)
21+
response = requests.get(self.url_path, params=self._query_prams, headers=self._local_headers)
22+
# print(response.url)
2923
logging.info('url', response.url)
3024
if response.ok:
3125
json_response = response.json()

package.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"name": "contentstack-python",
3+
"version": "1.0.0",
4+
"dependencies": {
5+
6+
}
7+
}

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@
1313
license='',
1414
author='shailesh-mishra',
1515
author_email='',
16-
description='', install_requires=['requests']
16+
description='', install_requires=['requests', 'config']
1717
)

0 commit comments

Comments
 (0)