Skip to content

Commit

Permalink
Send data to ServiceClients only if present (#39)
Browse files Browse the repository at this point in the history
* Provide json data to service client only if present. Fixes #38 
* Scope requests to install internal dependencies for doc building. Fixes failing doc builds.
  • Loading branch information
nikhilym authored Oct 20, 2018
1 parent 4d0e74a commit ed0d650
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion ask-sdk-core/ask_sdk_core/api_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,11 @@ def invoke(self, request):
raise ApiClientException(
"Requests against non-HTTPS endpoints are not allowed.")

raw_data = json.dumps(request.body)
if request.body:
raw_data = json.dumps(request.body)
else:
raw_data = None

http_response = http_method(
url=request.url, headers=http_headers, data=raw_data)

Expand Down
2 changes: 1 addition & 1 deletion ask-sdk-core/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
six
typing
requests
requests<=2.19.1
python_dateutil
ask-sdk-model

0 comments on commit ed0d650

Please sign in to comment.