Skip to content

Commit

Permalink
#17: Add example to the documentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
annoviko committed Sep 29, 2021
1 parent 41a9eb9 commit d932c3f
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/HttpCtrl/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1140,6 +1140,15 @@ def reply_by(self, status, body=None):
${response body}= Set Variable { "status": "accepted" }
Reply By 204 ${response body}
Example how to reply with a body represented by a sequence of bytes:
..code:: text
Wait For Request
${body bytes}= Evaluate bytes((0x0a, 0x12, 0x0a))
Reply By 200 ${body bytes}
"""
response = Response(int(status), None, body, self.__response_headers)
ResponseStorage().push(response)
Expand Down

0 comments on commit d932c3f

Please sign in to comment.