stasis-http: Provide a response body for 201 created responses

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@389639 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
David M. Lee
2013-05-23 21:46:38 +00:00
parent 9c7c1897e5
commit 32a86f902a
4 changed files with 15 additions and 7 deletions

View File

@@ -311,7 +311,7 @@ void stasis_http_response_error(struct stasis_http_response *response,
void stasis_http_response_ok(struct stasis_http_response *response,
struct ast_json *message)
{
response->message = message;
response->message = ast_json_ref(message);
response->response_code = 200;
response->response_text = "OK";
}
@@ -331,9 +331,9 @@ void stasis_http_response_alloc_failed(struct stasis_http_response *response)
}
void stasis_http_response_created(struct stasis_http_response *response,
const char *url)
const char *url, struct ast_json *message)
{
response->message = ast_json_null();
response->message = ast_json_ref(message);
response->response_code = 201;
response->response_text = "Created";
ast_str_append(&response->headers, 0, "Location: %s\r\n", url);