Simplified samples.

This commit is contained in:
PJ Dietz 2012-11-29 16:10:50 -05:00
parent bb44b27787
commit 85e51bbca9
4 changed files with 18 additions and 22 deletions

View File

@ -1,21 +0,0 @@
<?php
/**
* This is the file that is requested by client-set-request-and-response.php
*
* Feel free to modify this script, then run client-set-request-and-response.php
* to see the results.
*/
require_once('../Response.inc.php');
// Create a new Response instance.
$resp = new \wellrested\Response();
$resp->statusCode = 200;
$resp->setHeader('Content-Type', 'text/plain');
$resp->setHeader('User-Agent', 'Well RESTed');
$resp->body = 'The test works!';
$resp->respond();
exit;
?>

View File

@ -18,7 +18,7 @@ $rqst = new \wellrested\Request();
// Use the client-site-endpoint.php script
$rqst->hostname = $_SERVER['HTTP_HOST'];
$rqst->path = '/wellrested/samples/client-side-endpoint.php';
$rqst->path = '/wellrested/samples/server-side-response.php';
// Issue the request, and read the response returned by the server.
try {

View File

@ -0,0 +1,17 @@
<?php
/**
* Create and output a response from the server.
*/
require_once('../Response.inc.php');
// Create a new Response instance.
$resp = new \wellrested\Response();
$resp->statusCode = 200;
$resp->setHeader('Content-Type', 'text/plain');
$resp->body = 'This is a response.';
$resp->respond();
exit;
?>