Python vnd content-type header support

Adding vendor header support like : "Content-Type: application/vnd.api+json" and "Content-Type: application/vnd.api+json; version=1"
This commit is contained in:
Laurynas 2016-07-04 15:22:54 -04:00 committed by GitHub
parent 873e3974ed
commit df695ee2c4

View File

@ -121,7 +121,7 @@ class RESTClientObject(object):
if method in ['POST', 'PUT', 'PATCH', 'OPTIONS', 'DELETE']: if method in ['POST', 'PUT', 'PATCH', 'OPTIONS', 'DELETE']:
if query_params: if query_params:
url += '?' + urlencode(query_params) url += '?' + urlencode(query_params)
if headers['Content-Type'] == 'application/json': if headers['Content-Type'].find('+json') != -1:
request_body = None request_body = None
if body: if body:
request_body = json.dumps(body) request_body = json.dumps(body)