Skip to content

Commit 3ebe0d7

Browse files
committed
Modifying configuration file information
1 parent bca4be7 commit 3ebe0d7

File tree

4 files changed

+8
-16
lines changed

4 files changed

+8
-16
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ __pycache__/
44

55
# Virtual Environment
66
venv/
7+
dist/
78
env/
89
bin/
910
lib/

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Supported Python Versions
3131
## Installation
3232

3333
```
34-
$ pip install trackingmore
34+
$ pip install trackingmore-sdk-python
3535
```
3636

3737
## Via source code

pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[tool.poetry]
2-
name = "trackingmore"
2+
name = "trackingmore-sdk-python"
33
version = "0.1.0"
44
description = "The Python SDK of Trackingmore API"
55
authors = ["TrackingMore <manage@trackingmore.org>"]
@@ -18,6 +18,7 @@ packages = [
1818
[tool.poetry.dependencies]
1919
python = "^3.7"
2020
requests = "^2.31.0"
21+
urllib3 = "1.26.7"
2122

2223
[tool.poetry.dev-dependencies]
2324
pytest = "^7.4.2"

trackingmore/request.py

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@
1818

1919
headers = {}
2020

21-
proxy = 'http://192.168.2.198:7890'
22-
2321
def get_request_url(path):
2422
pact = 'https' if apiPort == 443 else 'http'
2523
url = pact+'://'+apiBaseUrl+'/'+apiVersion+'/'+path
@@ -37,14 +35,6 @@ def make_request( method='GET', path ='', params=None):
3735

3836
headers = get_request_header(get_api_key())
3937

40-
verify = False
41-
42-
if proxy:
43-
proxies = {
44-
'http': proxy,
45-
'https': proxy,
46-
}
47-
4838
json_data = None
4939
if params is not None:
5040
if method == 'GET':
@@ -53,13 +43,13 @@ def make_request( method='GET', path ='', params=None):
5343
json_data = json.dumps(params)
5444

5545
if method == 'GET':
56-
response = requests.get(url, headers=headers, timeout=timeout, verify=verify, proxies=proxies)
46+
response = requests.get(url, headers=headers, timeout=timeout)
5747
elif method == 'POST':
58-
response = requests.post(url, headers=headers, data=json_data, timeout=timeout, verify=verify, proxies=proxies)
48+
response = requests.post(url, headers=headers, data=json_data, timeout=timeout)
5949
elif method == 'PUT':
60-
response = requests.put(url, headers=headers, data=json_data, timeout=timeout, verify=verify, proxies=proxies)
50+
response = requests.put(url, headers=headers, data=json_data, timeout=timeout)
6151
elif method == 'DELETE':
62-
response = requests.delete(url, headers=headers, timeout=timeout, verify=verify, proxies=proxies)
52+
response = requests.delete(url, headers=headers, timeout=timeout)
6353
else:
6454
raise TrackingMoreException('Unsupported HTTP method: {}'.format(method))
6555

0 commit comments

Comments
 (0)