Skip to content

Conversation

@zeryx
Copy link
Contributor

@zeryx zeryx commented Jun 21, 2021

Migrated logic from #84
ran into some complications in a previous PR; but changelog looks pretty clean now, unsure how to fix whitespace issue easily but testing is completely functional.

def create_algo_response(responseJson):
# Parse response JSON
if 'error' in responseJson:
def create_algo_response(response):
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has been renamed, because the response might not be json

response = self.requestSession.post(self.apiAddress + url, data=input_json, headers=headers, params=query_parameters)

if parse_response_as_json:
if parse_response_as_json and response.status_code == 200:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

checks to ensure that the response is 200; which our API servers always set, but if there's a failure along the path we might not be able to deserialize as json

@zeryx zeryx requested a review from kennydaniel June 21, 2021 20:50
@zeryx zeryx self-assigned this Jun 21, 2021
Copy link
Contributor

@kennydaniel kennydaniel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That looks much better 👍

@zeryx zeryx merged commit 5da25ac into develop Jun 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants