0
использования apigility получить JSon ответ на почтальона , когда я отправить запрос пост в почтальона и вернуть ответ, как этотнежелательный текст ответа в покое apigility
{
"\u0000*\u0000version": null,
"\u0000*\u0000contentSent": false,
"\u0000*\u0000recommendedReasonPhrases": {
"100": "Continue",
"101": "Switching Protocols",
"102": "Processing",
"200": "OK",
"201": "Created",
"202": "Accepted",
"203": "Non-Authoritative Information",
"204": "No Content",
"205": "Reset Content",
"206": "Partial Content",
.
.
.
"508": "Loop Detected",
"511": "Network Authentication Required"
},
"\u0000*\u0000statusCode": 200,
"\u0000*\u0000reasonPhrase": null,
"\u0000*\u0000headers": {},
"\u0000*\u0000metadata": [],
"\u0000*\u0000content": "{\"success\":\"this is test\"}",
"_links": {
"self": {
"href": "http://xxxxx/xxxxx/public/userapi"
}
}
мой код в userapiresource.php, используя данные таблицы прибудете и возврат он также выход как этот
public function create($data)
{
$response=new HttpResponse;
$response->setContent(\Zend\Json\Json::encode(array('success'=>"this is test")));
return $response;
}