comparison Resources/Samples/Python/RestToolbox.py @ 354:4d76fce206ef

fixes
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 30 Jan 2013 14:34:36 +0100
parents 107da6a8c630
children 76bc8770741b
comparison
equal deleted inserted replaced
353:61e4c62b8c35 354:4d76fce206ef
36 36
37 if isinstance(data, str): 37 if isinstance(data, str):
38 body = data 38 body = data
39 if len(contentType) != 0: 39 if len(contentType) != 0:
40 headers = { 'content-type' : contentType } 40 headers = { 'content-type' : contentType }
41 else:
42 headers = { 'content-type' : 'text/plain' }
41 else: 43 else:
42 body = json.dumps(data) 44 body = json.dumps(data)
43 headers = { 'content-type' : 'application/json' } 45 headers = { 'content-type' : 'application/json' }
44 46
45 resp, content = h.request( 47 resp, content = h.request(