Skip to content

Commit 4fc51c2

Browse files
committed
fixed response encoding issue
1 parent cb60870 commit 4fc51c2

2 files changed

Lines changed: 8 additions & 6 deletions

File tree

README.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ python3 setup.py install
66

77
## Usage
88

9-
## Authentication
9+
## Basic Authentication
1010

1111
#### API User Keys
1212

@@ -76,13 +76,15 @@ body = {
7676
'providers': []
7777
}
7878
}
79-
attacks.create_attack(body=body, teamId=config.team_guid)
79+
attack_guid = attacks.create_attack(body=body, teamId=config.team_guid)
8080
```
8181

8282
## Organization and Team management
8383

84+
#### List all teams
8485
```python
85-
import gremlinapi
86-
gremlinapi.config.GremlinAPIConfig.bearer_token = 'Bearer MU3...ZiTk...Lo...4zO..c='
87-
gremlinapi.orgs.GremlinAPIOrgs.list_orgs()
86+
from gremlinapi.config import GremlinAPIConfig as config
87+
from gremlinapi.orgs import GremlinAPIOrgs as orgs
88+
config.bearer_token = 'Bearer MU3...ZiTk...Lo...4zO..c='
89+
orgs.list_orgs()
8890
```

gremlinapi/http_clients.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ def api_call(cls, method, endpoint, *args, **kwargs):
8989
body = resp.json()
9090
except ValueError:
9191
# No JSON in response
92-
body = resp.content
92+
body = str(resp.content, resp.encoding)
9393

9494
if resp.status_code >= 400:
9595
log.debug(f'{client}\n{uri}\n{data}\n{kwargs}')

0 commit comments

Comments
 (0)