Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -309,3 +309,6 @@ samples/client/petstore/ocaml-recursion-test/_build/

# jetbrain http client
samples/client/jetbrains/adyen/checkout71/http/client/Apis/http-client.private.env.json

# Generated by the run-in-docker.sh
?/
Comment thread
ilayu-blip marked this conversation as resolved.
Outdated
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,8 @@ class RESTClientObject:
if re.search('json', headers['Content-Type'], re.IGNORECASE):
if body is not None:
body = json.dumps(body)
if body is None and post_params:
body = json.dumps(dict(post_params))
args["data"] = body
elif headers['Content-Type'] == 'application/x-www-form-urlencoded': # noqa: E501
args["data"] = aiohttp.FormData(post_params)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,8 @@ class RESTClientObject:
request_body = None
if body is not None:
request_body = json.dumps(body)
if body is None and post_params:
request_body = json.dumps(dict(post_params))
r = self.pool_manager.request(
method, url,
body=request_body,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@ class RESTClientObject:
if re.search('json', headers['Content-Type'], re.IGNORECASE):
if body:
body = json.dumps(body)
if body is None and post_params:
body = json.dumps(dict(post_params))
request.body = body
elif headers['Content-Type'] == 'application/x-www-form-urlencoded': # noqa: E501
request.body = urlencode(post_params)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,8 @@ class RESTClientObject:
if re.search('json', headers['Content-Type'], re.IGNORECASE):
if body is not None:
body = json.dumps(body)
if body is None and post_params:
body = json.dumps(dict(post_params))
args["data"] = body
elif headers['Content-Type'] == 'application/x-www-form-urlencoded':
args["data"] = aiohttp.FormData(post_params)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,8 @@ class RESTClientObject:
if re.search('json', headers['Content-Type'], re.IGNORECASE):
if body is not None:
args["json"] = body
if body is None and post_params:
args["json"] = dict(post_params)
elif headers['Content-Type'] == 'application/x-www-form-urlencoded': # noqa: E501
args["data"] = dict(post_params)
elif headers['Content-Type'] == 'multipart/form-data':
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,8 @@ class RESTClientObject:
if re.search('json', headers['Content-Type'], re.IGNORECASE):
if body:
body = json.dumps(body)
if body is None and post_params:
body = json.dumps(dict(post_params))
request.body = body
elif headers['Content-Type'] == 'application/x-www-form-urlencoded':
request.body = urlencode(post_params)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,8 @@ def request(self, method, url, query_params=None, headers=None,
request_body = None
if body is not None:
request_body = json.dumps(body)
if body is None and post_params:
request_body = json.dumps(dict(post_params))
r = self.pool_manager.request(
method, url,
body=request_body,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,8 @@ async def request(
if re.search('json', headers['Content-Type'], re.IGNORECASE):
if body is not None:
body = json.dumps(body)
if body is None and post_params:
body = json.dumps(dict(post_params))
args["data"] = body
elif headers['Content-Type'] == 'application/x-www-form-urlencoded':
args["data"] = aiohttp.FormData(post_params)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,8 @@ async def request(
if re.search('json', headers['Content-Type'], re.IGNORECASE):
if body is not None:
args["json"] = body
if body is None and post_params:
args["json"] = dict(post_params)
elif headers['Content-Type'] == 'application/x-www-form-urlencoded': # noqa: E501
args["data"] = dict(post_params)
elif headers['Content-Type'] == 'multipart/form-data':
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,8 @@ async def request(self, method, url, query_params=None, headers=None,
if re.search('json', headers['Content-Type'], re.IGNORECASE):
if body is not None:
body = json.dumps(body)
if body is None and post_params:
body = json.dumps(dict(post_params))
args["data"] = body
elif headers['Content-Type'] == 'application/x-www-form-urlencoded': # noqa: E501
args["data"] = aiohttp.FormData(post_params)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,8 @@ def request(self, method, url, query_params=None, headers=None,
request_body = None
if body is not None:
request_body = json.dumps(body)
if body is None and post_params:
request_body = json.dumps(dict(post_params))
r = self.pool_manager.request(
method, url,
body=request_body,
Expand Down