Contents

Roo

Request.send

Sends this request to its URL using its specified HTTP method, headers, cookies and timeout period. Returns a Response object. This is a synchronous call so Roo will wait either until a response is received or the timeout period has elapsed.

var r = Request()
r.url = "https://jsonplaceholder.typicode.com/posts"
r.method = "POST"
r.content = '{"title": "foo", "body": "bar", "userId": 1}'
r.content_type = "application/json; charset=UTF-8"
var response = r.send
print(response.body)
# Prints:
#{
#  "title": "foo",
#  "body": "bar",
#  "userId": 1,
#  "id": 101
# }