Skip to content

Fix UnicodeDecodeError when POST'ing binary files

Latest
Compare
Choose a tag to compare
@johnschultz johnschultz released this 24 Mar 21:49
· 731 commits to master since this release

When Resources/Operations are constructed from api-docs, all fields (e.g. 'method') are unicode. In python 2.7 httplib attempts string concatenation to construct POST bodies, which means that UnicodeDecodeErrors occur if one includes binary data as a parameter. Rather than change all api-doc fields to 'str', this branch casts only fields used in httplib.