forked from loafle/openapi-generator-original
Move URL Query Parameters into All HTTP Verbs
HTTP Spec states that URL query parameters can be in all verbs. Should probably check all languages to make sure that query parameters are always passed even if it is not a GET call. Signed-off-by: George Sibble <gsibble@gmail.com>
This commit is contained in:
parent
68ce5d78f9
commit
c032b3c2d4
@ -44,17 +44,15 @@ class ApiClient:
|
||||
|
||||
data = None
|
||||
|
||||
if method == 'GET':
|
||||
if queryParams:
|
||||
# Need to remove None values, these should not be sent
|
||||
sentQueryParams = {}
|
||||
for param, value in queryParams.items():
|
||||
if value != None:
|
||||
sentQueryParams[param] = value
|
||||
url = url + '?' + urllib.urlencode(sentQueryParams)
|
||||
|
||||
if queryParams:
|
||||
# Need to remove None values, these should not be sent
|
||||
sentQueryParams = {}
|
||||
for param, value in queryParams.items():
|
||||
if value != None:
|
||||
sentQueryParams[param] = value
|
||||
url = url + '?' + urllib.urlencode(sentQueryParams)
|
||||
|
||||
elif method in ['POST', 'PUT', 'DELETE']:
|
||||
if method in ['POST', 'PUT', 'DELETE']:
|
||||
|
||||
if postData:
|
||||
headers['Content-type'] = 'application/json'
|
||||
|
@ -43,17 +43,16 @@ class ApiClient:
|
||||
|
||||
data = None
|
||||
|
||||
if method == 'GET':
|
||||
|
||||
if queryParams:
|
||||
# Need to remove None values, these should not be sent
|
||||
sentQueryParams = {}
|
||||
for param, value in queryParams.items():
|
||||
if value != None:
|
||||
sentQueryParams[param] = value
|
||||
url = url + '?' + urllib.parse.urlencode(sentQueryParams)
|
||||
if queryParams:
|
||||
# Need to remove None values, these should not be sent
|
||||
sentQueryParams = {}
|
||||
for param, value in queryParams.items():
|
||||
if value != None:
|
||||
sentQueryParams[param] = value
|
||||
url = url + '?' + urllib.parse.urlencode(sentQueryParams)
|
||||
|
||||
elif method in ['POST', 'PUT', 'DELETE']:
|
||||
if method in ['POST', 'PUT', 'DELETE']:
|
||||
|
||||
if postData:
|
||||
headers['Content-type'] = 'application/json'
|
||||
|
Loading…
x
Reference in New Issue
Block a user