mirror of
https://github.com/valitydev/openapi-generator.git
synced 2024-11-08 03:18:53 +00:00
case insensitive search for "json" in content-type headers
This commit is contained in:
parent
23b81324d1
commit
560f50ab9a
@ -10,6 +10,7 @@ import json
|
||||
import ssl
|
||||
import certifi
|
||||
import logging
|
||||
import re
|
||||
|
||||
# python 2 and python 3 compatibility library
|
||||
from six import iteritems
|
||||
@ -121,7 +122,7 @@ class RESTClientObject(object):
|
||||
if method in ['POST', 'PUT', 'PATCH', 'OPTIONS', 'DELETE']:
|
||||
if query_params:
|
||||
url += '?' + urlencode(query_params)
|
||||
if headers['Content-Type'].find('json') != -1:
|
||||
if re.search('json', headers['Content-Type'], re.IGNORECASE):
|
||||
request_body = None
|
||||
if body:
|
||||
request_body = json.dumps(body)
|
||||
|
Loading…
Reference in New Issue
Block a user