Skip to content

Commit

Permalink
Merge pull request #1 from chrysn-pull-requests/master
Browse files Browse the repository at this point in the history
Add content-format to response
  • Loading branch information
kelvan committed Aug 11, 2015
2 parents 8191b5b + ab3a76b commit 42b3518
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion coapserver.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ def render_post(self, request):
else:
return aiocoap.Message(code=aiocoap.NOT_FOUND, payload='Station not found'.encode('ascii'))

return aiocoap.Message(code=aiocoap.CONTENT, payload=payload.encode('UTF-8'))
response = aiocoap.Message(code=aiocoap.CONTENT, payload=payload.encode('UTF-8'))
response.opt.content_format = aiocoap.numbers.media_types_rev['application/json']
return response


def main():
Expand Down

0 comments on commit 42b3518

Please sign in to comment.