Skip to content

Latest commit

 

History

History
37 lines (24 loc) · 697 Bytes

index.md

File metadata and controls

37 lines (24 loc) · 697 Bytes

Haste Http

Various classes to ease HTTP handling.

Examples

Sending a general 200 OK response

<?php

$objResponse = new Haste\Http\Response\Response();
$objResponse->send();

Sending a 400 Bad Request response with foobar content

<?php

$objResponse = new Haste\Http\Response\Response('Foobar content', 400);
$objResponse->send();

Plaintext, HTML, XML and JSON

You can use different types of responses.

<?php

$objResponse = new Haste\Http\Response\Response();
$objResponse = new Haste\Http\Response\JsonResponse();
$objResponse = new Haste\Http\Response\HtmlResponse();
$objResponse = new Haste\Http\Response\XmlResponse();