PHP Classes

File: src/Generics/Streams/HttpStream.php

Recommend this page to a friend!
  Classes of Maik Greubel   PHP Generics   src/Generics/Streams/HttpStream.php   Download  
File: src/Generics/Streams/HttpStream.php
Role: Class source
Content type: text/plain
Description: Http stream interface
Class: PHP Generics
Framework for accessing streams, sockets and logs
Author: By
Last change: Update of src/Generics/Streams/HttpStream.php
Date: 7 months ago
Size: 1,447 bytes
 

Contents

Class file image Download
<?php

/**
 * This file is part of the PHP Generics package.
 *
 * @package Generics
 */
namespace Generics\Streams;

/**
 * This interfaces describes a HTTP Stream implementation
 *
 * @author Maik Greubel <greubel@nkey.de>
 */
interface HttpStream extends InputOutputStream
{

   
/**
     * Retrieve all headers as array
     *
     * @return array
     */
   
public function getHeaders(): array;

   
/**
     * Set a particular header to a corresponding value
     *
     * @param string $headerName
     * The header to set
     * @param string $headerValue
     * The value to set
     */
   
public function setHeader($headerName, $headerValue);

   
/**
     * Retrieve the payload (http body)
     *
     * @return InputOutputStream The payload as stream
     *
     * @throws \Generics\Streams\StreamException
     */
   
public function getPayload(): InputOutputStream;

   
/**
     * Append the payload (http body)
     *
     * @param InputStream $payload
     * The payload to append
     *
     * @throws \Generics\Streams\StreamException
     */
   
public function appendPayload(InputStream $payload);

   
/**
     * Start the request
     *
     * @param string $requestType
     * The type of request (GET, POST, etc.)
     *
     * @throws \Generics\Client\HttpException
     * @throws \Generics\Socket\SocketException
     */
   
public function request(string $requestType);
}