anonym-php/anonym-httpfoundation

AnonymFramework Http 基础组件

dev-master / 1.2.x-dev 2015-09-23 01:14 UTC

This package is not auto-updated.

Last update: 2024-09-14 17:53:39 UTC


README

在本说明中,我解释了如何使用具有的类来使用 http 客户端。

响应

$response = new Response('İçerik', 200); // durum kodu
// $response = Response::make('Hello World', 200);
// $response->setCharset('UTF-8');
$response->send();

getCookies

$cookies = $response->getCookies();

添加标题

$respone->header('baslik:deger');

JsonResponse

$json = $response->jsonResponse($json, 200);

XmlResponse

$xml= $reponse->xmlResponse($xml, 200);

重定向

$redirect = new RedirectResponse('url', $time); // yönlendirilecek adres ve süre, süre öntanımlı olarak 0 dır
$redirect->send();