PSR-7 HTTP Message implementation

Related tags

HTTP zend-diactoros
Overview

zend-diactoros

Repository abandoned 2019-12-31

This repository has moved to laminas/laminas-diactoros.

Master: Build status Coverage Status Develop: Build status Coverage Status

Diactoros (pronunciation: /dɪʌktɒrɒs/): an epithet for Hermes, meaning literally, "the messenger."

This package supercedes and replaces phly/http.

zend-diactoros is a PHP package containing implementations of the PSR-7 HTTP message interfaces and PSR-17 HTTP message factory interfaces.

Documentation

Documentation is available at:

Source files for documentation are in the docs/ tree.

Comments
  • Implemented bookdown.io docs

    Implemented bookdown.io docs

    This patch separates the various sections of README.md into discrete markdown files, and introduces bookdown as a development dependency for generating an HTML manual. Update: bookdown/bookdown was removed as a dependency; we will recommend installing it globally if you wish to render documentation.

    I have introduced custom templates and a custom Bootstrap-based CSS assets to provide a cleanly rendered manual for consumption. UPDATE: These were removed.

    Questions I have:

    • Should the templates and CSS be included? These can be omitted, and the content rendered cleanly, albeit very plainly, without them, and we could have those as part of a master "manual" project instead. UPDATE: the master templates and CSS will be in the documentation repository.
    • Does the structure seem reasonable? does it seem reasonable if we decide not to ship templates and CSS? UPDATE: The only change to the structure since the original commit for this PR was to move the bookdown.json up a level.
    enhancement documentation 
    opened by weierophinney 37
  • Unexpected 'function

    Unexpected 'function": zend-diactoros/src/functions/marshal_headers_from_sapi.php on line 10

    Hello I recently ran into a problem running zend-diactoros 1.8.1 with a Drupal distribution and Acquia Dev Desktop. Downgrading to 1.7.2 got everything working again.

    Here's the error: PHP Parse error: syntax error, unexpected 'function' (T_FUNCTION), expecting identifier (T_STRING) or \\ (T_NS_SEPARATOR) in /Users/name/Sites/devdesktop/website-dev/vendor/zendframework/zend-diactoros/src/functions/marshal_headers_from_sapi.php on line 10

    and here's the full stack trace: `Call Stack: 0.0021 123204 1. {main}() /Applications/DevDesktop/tools/vendor/drush/drush/drush.php:0 0.0047 252652 2. drush_main() /Applications/DevDesktop/tools/vendor/drush/drush/drush.php:12 0.6006 8062072 3. Drush\Boot\BaseBoot->bootstrap_and_dispatch() /Applications/DevDesktop/tools/vendor/drush/drush/includes/preflight.inc:66 0.6088 8068264 4. drush_dispatch() /Applications/DevDesktop/tools/vendor/drush/drush/lib/Drush/Boot/BaseBoot.php:67 0.6122 8071720 5. call_user_func_array:{/Applications/DevDesktop/tools/vendor/drush/drush/includes/command.inc:199}() /Applications/DevDesktop/tools/vendor/drush/drush/includes/command.inc:199 0.6122 8071904 6. drush_command() /Applications/DevDesktop/tools/vendor/drush/drush/includes/command.inc:199 0.6126 8072544 7. _drush_invoke_hooks() /Applications/DevDesktop/tools/vendor/drush/drush/includes/command.inc:231 0.6239 8287916 8. call_user_func_array:{/Applications/DevDesktop/tools/vendor/drush/drush/includes/command.inc:422}() /Applications/DevDesktop/tools/vendor/drush/drush/includes/command.inc:422 0.6239 8288036 9. drush_sql_dump() /Applications/DevDesktop/tools/vendor/drush/drush/includes/command.inc:422 0.6239 8288052 10. drush_sql_bootstrap_further() /Applications/DevDesktop/tools/vendor/drush/drush/commands/sql/sql.drush.inc:251 0.6242 8288072 11. drush_sql_bootstrap_database_configuration() /Applications/DevDesktop/tools/vendor/drush/drush/commands/sql/sql.drush.inc:197 0.6242 8288144 12. drush_bootstrap_max() /Applications/DevDesktop/tools/vendor/drush/drush/commands/sql/sql.drush.inc:186 0.6263 8289020 13. drush_bootstrap_validate() /Applications/DevDesktop/tools/vendor/drush/drush/includes/bootstrap.inc:507 0.6278 8290028 14. Drush\Boot\DrupalBoot->bootstrap_drupal_root_validate() /Applications/DevDesktop/tools/vendor/drush/drush/includes/bootstrap.inc:430 0.6285 8290056 15. drush_drupal_version() /Applications/DevDesktop/tools/vendor/drush/drush/lib/Drush/Boot/DrupalBoot.php:268 0.6291 8290080 16. Drush\Boot\DrupalBoot8->get_version() /Applications/DevDesktop/tools/vendor/drush/drush/includes/drupal.inc:43 0.6291 8290096 17. drush_drupal_load_autoloader() /Applications/DevDesktop/tools/vendor/drush/drush/lib/Drush/Boot/DrupalBoot8.php:40 0.6293 8293152 18. require('/Users/name/Sites/devdesktop/website-dev/docroot/autoload.php') /Applications/DevDesktop/tools/vendor/drush/drush/includes/drupal.inc:17 0.6293 8294472 19. require('/Users/name/Sites/devdesktop/website-dev/vendor/autoload.php') /Users/name/Sites/devdesktop/website-dev/docroot/autoload.php:17 0.6296 8306404 20. ComposerAutoloaderInit3b0e50ed5f365629937fa738e0be1282::getLoader() /Users/name/Sites/devdesktop/website-dev/vendor/autoload.php:7 0.6400 8830052 21. composerRequire3b0e50ed5f365629937fa738e0be1282() /Users/name/Sites/devdesktop/website-dev/vendor/composer/autoload_real.php:56

    PHP Parse error: syntax error, unexpected 'function' (T_FUNCTION), expecting identifier (T_STRING) or \ (T_NS_SEPARATOR) in /Users/name/Sites/devdesktop/website-dev/vendor/zendframework/zend-diactoros/src/functions/marshal_headers_from_sapi.php on line 10 PHP Stack trace: PHP 1. {main}() /Applications/DevDesktop/tools/vendor/drush/drush/drush.php:0 PHP 2. drush_main() /Applications/DevDesktop/tools/vendor/drush/drush/drush.php:12 PHP 3. Drush\Boot\BaseBoot->bootstrap_and_dispatch() /Applications/DevDesktop/tools/vendor/drush/drush/includes/preflight.inc:66 PHP 4. drush_dispatch() /Applications/DevDesktop/tools/vendor/drush/drush/lib/Drush/Boot/BaseBoot.php:67 PHP 5. call_user_func_array:{/Applications/DevDesktop/tools/vendor/drush/drush/includes/command.inc:199}() /Applications/DevDesktop/tools/vendor/drush/drush/includes/command.inc:199 PHP 6. drush_command() /Applications/DevDesktop/tools/vendor/drush/drush/includes/command.inc:199 PHP 7. _drush_invoke_hooks() /Applications/DevDesktop/tools/vendor/drush/drush/includes/command.inc:231 PHP 8. call_user_func_array:{/Applications/DevDesktop/tools/vendor/drush/drush/includes/command.inc:422}() /Applications/DevDesktop/tools/vendor/drush/drush/includes/command.inc:422 PHP 9. drush_sql_dump() /Applications/DevDesktop/tools/vendor/drush/drush/includes/command.inc:422 PHP 10. drush_sql_bootstrap_further() /Applications/DevDesktop/tools/vendor/drush/drush/commands/sql/sql.drush.inc:251 PHP 11. drush_sql_bootstrap_database_configuration() /Applications/DevDesktop/tools/vendor/drush/drush/commands/sql/sql.drush.inc:197 PHP 12. drush_bootstrap_max() /Applications/DevDesktop/tools/vendor/drush/drush/commands/sql/sql.drush.inc:186 PHP 13. drush_bootstrap_validate() /Applications/DevDesktop/tools/vendor/drush/drush/includes/bootstrap.inc:507 PHP 14. Drush\Boot\DrupalBoot->bootstrap_drupal_root_validate() /Applications/DevDesktop/tools/vendor/drush/drush/includes/bootstrap.inc:430 PHP 15. drush_drupal_version() /Applications/DevDesktop/tools/vendor/drush/drush/lib/Drush/Boot/DrupalBoot.php:268 PHP 16. Drush\Boot\DrupalBoot8->get_version() /Applications/DevDesktop/tools/vendor/drush/drush/includes/drupal.inc:43 PHP 17. drush_drupal_load_autoloader() /Applications/DevDesktop/tools/vendor/drush/drush/lib/Drush/Boot/DrupalBoot8.php:40 PHP 18. require() /Applications/DevDesktop/tools/vendor/drush/drush/includes/drupal.inc:17 PHP 19. require() /Users/name/Sites/devdesktop/website-dev/docroot/autoload.php:17 PHP 20. ComposerAutoloaderInit3b0e50ed5f365629937fa738e0be1282::getLoader() /Users/name/Sites/devdesktop/website-dev/vendor/autoload.php:7 PHP 21. composerRequire3b0e50ed5f365629937fa738e0be1282() /Users/name/Sites/devdesktop/website-dev/vendor/composer/autoload_real.php:56 Drush command terminated abnormally due to an unrecoverable error. [error] Error: syntax error, unexpected 'function' (T_FUNCTION), expecting identifier (T_STRING) or \ (T_NS_SEPARATOR) in /Users/name/Sites/devdesktop/website-dev/vendor/zendframework/zend-diactoros/src/functions/marshal_headers_from_sapi.php, line 10 [0.6 sec, 8.42 MB]`

    wontfix 
    opened by jazty 23
  • Invalid Content-Length header (and/or issue with output-buffering)

    Invalid Content-Length header (and/or issue with output-buffering)

    The SapiEmitter generates a Content-Length header based on the length of the body stream length.

    But it also flushes any existing output buffer, and doesn't take measures to prevent both of those those things happening during the same request.

    This can leads to an invalid HTTP response body getting emitted, which e.g. Chrome will refuse to even display.

    For example, if you var_dump('something') and then emit, you end up with a broken response.

    I suspect this is what leads to bug-reports such as #216.

    A check should probably be introduced to prevent this, as it's likely a common mistake - rather than creating an invalid response, we should probably throw an exception?

    opened by mindplay-dk 22
  • Fix: Return static instead of self

    Fix: Return static instead of self

    This PR

    • [x] updates docblocks of MessageTrait and ResponseTrait to return static instead of self

    :question: Seems to make more sense to me, how about you?

    enhancement question 
    opened by localheinz 20
  • Shortcut method for creating response from a string

    Shortcut method for creating response from a string

    Creating a response object from a string of HTML (etc.) seems to be a very common use-case, so we might as well make it very easy (without having to handle streams).

    $voila = Response::fromString($html)
    
    enhancement 
    opened by franzliedke 19
  • Headers with value 0 being stripped out. Previous bugfix caused all headers to be accepted.

    Headers with value 0 being stripped out. Previous bugfix caused all headers to be accepted.

    Provide a narrative description of what you are trying to accomplish:

    • [x] Are you fixing a bug?
      • [x] Detail how the bug is invoked currently.
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, 'http://xxx.xxx.xxx');
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PATCH");
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_HEADER, true);
    curl_setopt($ch, CURLOPT_HTTPHEADER, ["Upload-Offset: 0"]);
    curl_exec($ch);
    
    • [x] Detail the original, incorrect behavior. The header Upload-Offset is being stripped. (Any header with value "0") The value was being used in a conditional. To test !!("0") === false. Test was incorrect because the header was being stripped because it was not prefixed with HTTP_. Relates to #347 #342 #344
    • [x] Detail the new, expected behavior. Values with a string of "0" should be accepted Test passes with proper header formation.
    • [x] Base your feature on the master branch, and submit against that branch.
    • [x] Add a regression test that demonstrates the bug, and proves the fix.
    • [x] Add a CHANGELOG.md entry for the fix.
    bug 
    opened by bluebaroncanada 15
  • Segfault in PHP 7.3.0 when instantiating HtmlResponse in Built-in Web Server

    Segfault in PHP 7.3.0 when instantiating HtmlResponse in Built-in Web Server

    • [x] This is not a question. (Questions should be asked on chat (Signup here) or our forums.)
    • [x] I was not able to find an open or closed issue matching what I'm seeing.

    I'm developing a tiny REST Api using PHP. For HTTP I've decided to go with Diactoros. However, when I'm developing with PHP's Built-in web server, I get a segmentation fault when instantiating HtmlResponse. You can replicate it just by doing:

    Steps to Reproduce

    <?php
    
    require_once __DIR__.'/../vendor/autoload.php';
    
    $response = new \Zend\Diactoros\Response\HtmlResponse('Testing');
    

    Then, run that file using php server: php -S 0.0.0.0:8000 -t .

    Extra Research

    Before you say that this is a PHP issue, I executed the code of what Diactoros does under the hood, and I didn't ran into any issues. For instance:

    $string = 'Dummy string';
    
    $stream = fopen('php://temp', 'wb+');
    fwrite($stream, $string);
    fseek($stream, 0);
    
    if (ftell($stream) === 0) {
        echo 'Code works!'.PHP_EOL;
    } else {
        echo 'Code does not work!'.PHP_EOL;
    }
    
    fclose($stream);
    

    My guess is that is something stream related, but I cannot figure out what. It is also weird that only happens when using the web server, and not if I run the script using the cli.

    opened by mnavarrocarter 13
  • Removes Content-Length injection and output buffer flushing

    Removes Content-Length injection and output buffer flushing

    Per discussion on #251, we have two "features" in Diactoros that tend to cause problems:

    • Auto-injection of the Content-Length header causes issues when any output is emitted via the output buffer. What tends to happen is that the contents of the output buffer are emitted up to the Content-Length. As a result, this content is truncated, or, in the case that it is shorter, the original content of the response is truncated. In either situation, the results are difficult to debug.
    • By flushing the output buffer, we run into two issues: the Content-Length issues previously mentioned, but also mixed content, which typically breaks clients.

    As discussed in the issue, the proper solution is a couple of BC breaks:

    • We remove the Content-Length auto-injection. If developers want this, they can now use Zend\Expressive\Helper\ContentLengthMiddleware from zend-expressive-helpers 4.1.0.
    • We no longer do anything with output buffers in either the SAPI emitters or the Server class. Emitters now check for either headers sent, or an existing output buffer with content length > 0; if either case occurs, they raise an exception, as the emitter cannot properly emit the response.

    Essentially, this approach forces the developer to choose to use PSR-7 fully, or create their own emitter and/or server implementation if they want to allow mixed global/PSR-7 usage.

    bug BC break 
    opened by weierophinney 13
  • Unable to handle formData

    Unable to handle formData

    Hi,

    I'm trying to use formData to have a generic function to send form using Ajax but without any success. I use the following javascript code data: new FormData( _this[ 0 ] ) to send all data using FormData. I set the request header Content-type: multipart/form-databut when trying to get the content via $request->getParsedBody()the content is empty. I get a 0 length array.

    If I look at the request parameters (in my browser) I have the following request payload:

    -----------------------------20852767153126299651626821193
    Content-Disposition: form-data; name="username"
    
    mylogin
    -----------------------------20852767153126299651626821193
    Content-Disposition: form-data; name="password"
    
    mypassword
    -----------------------------20852767153126299651626821193--
    

    Do you now how I can manage this ?

    Regards

    question 
    opened by Wikiki 13
  • Serialization of Request

    Serialization of Request

    
        public function testSerialization()
        {
            $request = new \Zend\Diactoros\Request('https://example.com', 'GET');
            $serialized = \Zend\Diactoros\Request\Serializer::toString($request);
            $unserialized = \Zend\Diactoros\Request\Serializer::fromString($serialized);
            $this->assertEquals((string)$request->getUri(), (string)$unserialized->getUri());
            $this->assertEquals($request->getHeaders(), $unserialized->getHeaders());
            $this->assertEquals($request->getRequestTarget(), $unserialized->getRequestTarget());
        }
    
    Failed asserting that two strings are equal.
    --- Expected
    +++ Actual
    @@ @@
    -'https://example.com'
    +'/'
    
    

    Absolute-form of request-target should be used during serialization of Request object because otherwise we lose information about uri schema (https in this case).

     public function testSerialization()
        {
            $request = new \Zend\Diactoros\Request();
            $serialized = \Zend\Diactoros\Request\Serializer::toString($request);
            $unserialized = \Zend\Diactoros\Request\Serializer::fromString($serialized);
            $this->assertEquals((string)$request->getUri(), (string)$unserialized->getUri());
            $this->assertEquals($request->getHeaders(), $unserialized->getHeaders());
            $this->assertEquals($request->getRequestTarget(), $unserialized->getRequestTarget());
        }
    
    UnexpectedValueException: Invalid request line detected
    

    Maybe there should be another approach for serializing of Request which allows serialization of partial filled objects?

    opened by dzentota 13
  • Encoding of

    Encoding of "null" or scalar in JsonResponse

    Hey @weierophinney ,

    This is more of an open question than an issue.

    In JsonResponse, encoding of "null" is transformed into []. Encoding of a string like "foo" is transformed into ["foo"].

    However, by default,

    json_encode(null) === "null";
    json_encode("foo") === '"foo"';
    

    I feel that the default behaviour makes more sense, and is less tricky for the user. However, I guess there must be a reason why you wrap scalar types into arrays, and null into an empty array, but I don't understand why.

    For information, in other places (Symfony JsonResponse), they seem to transform null into [], but they are not wrapping scalars into arrays. I don't know why either... Any clue why the wrapping?

    question 
    opened by moufmouf 13
  • Probably an incorrect test case testAuthorityIsPrefixedByDoubleSlashIfPresent in UriTest.php

    Probably an incorrect test case testAuthorityIsPrefixedByDoubleSlashIfPresent in UriTest.php

    Two tests are looking identical despite description. Probably withHost in second case should be replaced by something else.

        public function testUriDoesNotAppendColonToHostIfPortIsEmpty()
        {
            $uri = (new Uri())->withHost('google.com');
            $this->assertSame('//google.com', (string) $uri);
        }
        public function testAuthorityIsPrefixedByDoubleSlashIfPresent()
        {
            $uri = (new Uri())->withHost('example.com');
            $this->assertSame('//example.com', (string) $uri);
        }
    
    opened by Keksov 1
  • PhpInputStream's getSize function is Wrong!

    PhpInputStream's getSize function is Wrong!

    reference: https://www.php.net/manual/en/wrappers.php.php php://input is not support fstat

    Supports stat() | php://memory and php://temp only. -- | --

    • [ ] I was not able to find an open or closed issue matching what I'm seeing.
    • [ ] This is not a question. (Questions should be asked on chat (Signup here) or our forums.)

    Provide a narrative description of what you are trying to accomplish.

    Code to reproduce the issue

    Expected results

    Actual results

    Awaiting author feedback 
    opened by zhushengwen 4
  • Can UploadedFile extend SplFileInfo ?

    Can UploadedFile extend SplFileInfo ?

    Is there a particular reason that UploadedFile does not extend SplFileInfo. The only conflicting interface, which isn't even really a conflict so much is getSize() -- would there be any interest in this? I can do a PR if the interest is there.

    I need this feature like yesterday and without it I'm either gonna need to look for an alternative or fork.

    opened by mattsah 12
  • LTS Version 1.7 is missing a security fix

    LTS Version 1.7 is missing a security fix

    • [x] I was not able to find an open or closed issue matching what I'm seeing.
    • [x] This is not a question. (Questions should be asked on chat (Signup here) or our forums.)

    According to https://framework.zend.com/long-term-support 1.7 is the long term support version of zend-diactoros, however the Symfony security scanner shows that 1.7.2 is missing the fix for the URL Rewrite vulnerability [CVE-NONE-0001]: https://framework.zend.com/security/advisory/ZF2018-01

    I've tried to be helpful and backport this in https://github.com/alexpott/zend-diactoros/tree/1.7.x-CVE-NONE-0001 but I can't create a PR because there is no 1.7 release branch.

    Code to reproduce the issue

            $server = [
                'REQUEST_URI' => 'https://example.com/requested/path',
                'HTTP_X_ORIGINAL_URL' => '/hijack-attempt'
            ];
            $path = ServerRequestFactory::marshalRequestUri($server);
    

    Expected results

            $path === '/requested/path';
    

    Actual results

            $path === '/hijack-attempt';
    
    opened by alexpott 5
  • Generators are not supported for JSON responses.

    Generators are not supported for JSON responses.

    Code to reproduce the issue

    function getSomeData(): Generator {
        yield 1 => 'One';
        yield 2 => 'Two';
        yield 3 => 'Three';
    }
    
    $data = getSomeData();
    $json = new Zend\Diactoros\Response\JsonResponse($data);
    

    Expected results

    Response should consume the generator and treat it as if a normal PHP array was passed in:

    $data = [
        1 => 'One',
        2 => 'Two',
        3 => 'Three'
    ];
    
    $json = new Zend\Diactoros\Response\JsonResponse($data);
    

    Actual results

    An error is thrown instead: "Trying to clone an uncloneable object of class Generator..."

    opened by nbish11 1
  • Add DownloadResponse Class

    Add DownloadResponse Class

    Why is the new feature needed? What purpose does it serve?

    After doing a bit of searching, I didn't find a class that would send a CSV response. There were the Text, JSON, HTML, Redirect, XML, and Empty response classes, but nothing specific to CSV. So I created this PR to add a CSV response class, which can send both plain CSV text as well as a response that will be interpreted by the client as a downloadable file.

    How will users use the new feature?

    Users can use the CSV response class very similarly to how they use the existing response classes. The only difference is that if they supply a file name as the third parameter to the constructor, then a download response will be sent, not a textual response.

    enhancement 
    opened by settermjd 11
Releases(2.2.1)
  • 2.2.1(Nov 13, 2019)

    Added

    • Nothing.

    Changed

    • #379 removes extension of SplFileInfo by the UploadedFile class. The signatures of getSize() are potentially incompatible, and UploadedFile is intended to work with arbitrary PHP and PSR-7 streams, whereas SplFileInfo can only model files on the filesystem. While this is technically a BC break, we are treating it as a bugfix, as the class was broken for many use cases.

    Deprecated

    • Nothing.

    Removed

    • Nothing.

    Fixed

    • Nothing.
    Source code(tar.gz)
    Source code(zip)
  • 2.2.0(Nov 12, 2019)

    Added

    • #376 adds support for using the X-Forwarded-Host header for determining the originally requested host name when marshaling the server request.

    Changed

    • #378 updates the UploadedFile class to extend SplFileInfo, allowing developers to make use of those features in their applications.

    Deprecated

    • Nothing.

    Removed

    • Nothing.

    Fixed

    • Nothing.
    Source code(tar.gz)
    Source code(zip)
  • 2.1.5(Oct 10, 2019)

    Added

    • Nothing.

    Changed

    • Nothing.

    Deprecated

    • Nothing.

    Removed

    • Nothing.

    Fixed

    • #372 fixes issues that occur in the Zend\Diactoros\Uri class when invalid UTF-8 characters are present the user-info, path, or query string, ensuring they are URL-encoded before being consumed. Previously, such characters could result in a fatal error, which was particularly problematic when marshaling the request URI for an application request cycle.
    Source code(tar.gz)
    Source code(zip)
  • 2.1.4(Oct 8, 2019)

    Added

    • Nothing.

    Changed

    • Nothing.

    Deprecated

    • Nothing.

    Removed

    • Nothing.

    Fixed

    • #370 updates Zend\Diactoros\marshalHeadersFromSapi() to ensure all underscores in header name keys are converted to dashes (fixing issues with header names such as CONTENT_SECURITY_POLICY, which would previously resolve improperly to content-security_policy).

    • #370 updates Zend\Diactoros\marshalHeadersFromSapi() to ignore header names from the $server array that resolve to integers; previously, it would raise a fatal error.

    Source code(tar.gz)
    Source code(zip)
  • 1.8.7(Aug 6, 2019)

    Added

    • Nothing.

    Changed

    • Nothing.

    Deprecated

    • Nothing.

    Removed

    • Nothing.

    Fixed

    • #364 modifies detection of HTTPS schemas via the $_SERVER['HTTPS'] value such that an empty HTTPS-key will result in a scheme of http and not https.
    Source code(tar.gz)
    Source code(zip)
  • 2.1.3(Jul 10, 2019)

    Added

    • Nothing.

    Changed

    • Nothing.

    Deprecated

    • Nothing.

    Removed

    • Nothing.

    Fixed

    • #363 modifies detection of HTTPS schemas via the $_SERVER['HTTPS'] value such that an empty HTTPS-key will result in a scheme of http and not https.
    Source code(tar.gz)
    Source code(zip)
  • 2.1.2(Apr 29, 2019)

    Added

    • Nothing.

    Changed

    • Nothing.

    Deprecated

    • Nothing.

    Removed

    • Nothing.

    Fixed

    • #355 adds phpdbg to the list of accepted non-SAPI enviornments for purposes of calling UploadedFile::moveTo().
    Source code(tar.gz)
    Source code(zip)
  • 2.1.1(Jan 5, 2019)

    Added

    • Nothing.

    Changed

    • Nothing.

    Deprecated

    • Nothing.

    Removed

    • Nothing.

    Fixed

    • #349 fixes an issue when marshaling headers with values of 0 or 0 from the SAPI, ensuring they are detected and injected into the ServerRequest properly.
    Source code(tar.gz)
    Source code(zip)
  • 2.0.3(Jan 5, 2019)

    Added

    • Nothing.

    Changed

    • Nothing.

    Deprecated

    • Nothing.

    Removed

    • Nothing.

    Fixed

    • #349 fixes an issue when marshaling headers with values of 0 or 0 from the SAPI, ensuring they are detected and injected into the ServerRequest properly.
    Source code(tar.gz)
    Source code(zip)
  • 2.1.0(Dec 20, 2018)

  • 2.0.2(Dec 20, 2018)

  • 2.0.1(Dec 3, 2018)

    Added

    • Nothing.

    Changed

    • Nothing.

    Deprecated

    • Nothing.

    Removed

    • Nothing.

    Fixed

    • #337 ensures that the ServerRequestFactory::createServerRequest() method creates a php://temp stream instead of a php::input stream, in compliance with the PSR-17 specification.
    Source code(tar.gz)
    Source code(zip)
  • 2.0.0(Sep 27, 2018)

    Added

    • #326 adds PSR-17 HTTP Message Factory implementations, including:

      • Zend\Diactoros\RequestFactory
      • Zend\Diactoros\ResponseFactory
      • Zend\Diactoros\ServerRequestFactory
      • Zend\Diactoros\StreamFactory
      • Zend\Diactoros\UploadedFileFactory
      • Zend\Diactoros\UriFactory

      These factories may be used to produce the associated instances; we encourage users to rely on the PSR-17 factory interfaces to allow exchanging PSR-7 implementations within their applications.

    • #328 adds a package-level exception interface, Zend\Diactoros\Exception\ExceptionInterface, and several implementations for specific exceptions raised within the package. These include:

      • Zend\Diactoros\Exception\DeserializationException (extends UnexpectedValueException)
      • Zend\Diactoros\Exception\InvalidArgumentException (extends InvalidArgumentException)
      • Zend\Diactoros\Exception\InvalidStreamPointerPositionException (extends RuntimeException)
      • Zend\Diactoros\Exception\SerializationException (extends UnexpectedValueException)
      • Zend\Diactoros\Exception\UnreadableStreamException (extends RuntimeException)
      • Zend\Diactoros\Exception\UnrecognizedProtocolVersionException (extends UnexpectedValueException)
      • Zend\Diactoros\Exception\UnrewindableStreamException (extends RuntimeException)
      • Zend\Diactoros\Exception\UnseekableStreamException (extends RuntimeException)
      • Zend\Diactoros\Exception\UntellableStreamException (extends RuntimeException)
      • Zend\Diactoros\Exception\UnwritableStreamException (extends RuntimeException)
      • Zend\Diactoros\Exception\UploadedFileAlreadyMovedException (extends RuntimeException)
      • Zend\Diactoros\Exception\UploadedFileErrorException (extends RuntimeException)

    Changed

    • #329 adds return type hints and scalar parameter type hints wherever possible. The changes were done to help improve code quality, in part by reducing manual type checking. If you are extending any classes, you may need to update your signatures; check the signatures of the class(es) you are extending for changes.

    • #162 modifies Serializer\Request such that it now no longer raises an UnexpectedValueException via its toString() method when an unexpected HTTP method is encountered; this can be done safely, as the value can never be invalid due to other changes in the same patch.

    • #162 modifies RequestTrait such that it now invalidates non-string method arguments to either the constructor or withMethod(), raising an InvalidArgumentException for any that do not validate.

    Deprecated

    • Nothing.

    Removed

    • #308 removes the following methods from the ServerRequestFactory class:

      • normalizeServer() (use Zend\Diactoros\normalizeServer() instead)
      • marshalHeaders() (use Zend\Diactoros\marshalHeadersFromSapi() instead)
      • marshalUriFromServer() (use Zend\Diactoros\marshalUriFromSapi() instead)
      • marshalRequestUri() (use Uri::getPath() from the Uri instance returned by marshalUriFromSapi() instead)
      • marshalHostAndPortFromHeaders() (use Uri::getHost() and Uri::getPort() from the Uri instances returned by marshalUriFromSapi() instead)
      • stripQueryString() (use explode("?", $path, 2)[0] instead)
      • normalizeFiles() (use Zend\Diactoros\normalizeUploadedFiles() instead)
    • #295 removes Zend\Diactoros\Server. You can use the RequestHandlerRunner class from zendframework/zend-httphandlerrunner to provide these capabilities instead.

    • #295 removes Zend\Diactoros\Response\EmitterInterface and the various emitter implementations. These can now be found in the package zendframework/zend-httphandlerrunner, which also provides a PSR-7-implementation agnostic way of using them.

    Fixed

    • Nothing.
    Source code(tar.gz)
    Source code(zip)
  • 1.8.6(Sep 5, 2018)

    Added

    • Nothing.

    Changed

    • #325 changes the behavior of ServerRequest::withParsedBody(). Per PSR-7, it now no longer allows values other than null, arrays, or objects.

    • #325 changes the behavior of each of Request, ServerRequest, and Response in relation to the validation of header values. Previously, we allowed empty arrays to be provided via withHeader(); however, this was contrary to the PSR-7 specification. Empty arrays are no longer allowed.

    Deprecated

    • Nothing.

    Removed

    • Nothing.

    Fixed

    • #325 ensures that Uri::withUserInfo() no longer ignores values of 0 (numeric zero).

    • #325 fixes how header values are merged when calling withAddedHeader(), ensuring that array keys are ignored.

    Source code(tar.gz)
    Source code(zip)
  • 1.8.5(Aug 10, 2018)

    Added

    • Nothing.

    Changed

    • Nothing.

    Deprecated

    • Nothing.

    Removed

    • Nothing.

    Fixed

    • #324 fixes a reference to an undefined variable in the ServerRequestFactory, which made it impossible to fetch a specific header by name.
    Source code(tar.gz)
    Source code(zip)
  • 1.8.4(Aug 1, 2018)

    Added

    • Nothing.

    Changed

    • This release modifies how ServerRequestFactory marshals the request URI. In prior releases, we would attempt to inspect the X-Rewrite-Url and X-Original-Url headers, using their values, if present. These headers are issued by the ISAPI_Rewrite module for IIS (developed by HeliconTech). However, we have no way of guaranteeing that the module is what issued the headers, making it an unreliable source for discovering the URI. As such, we have removed this feature in this release of Diactoros.

      If you are developing a middleware application, you can mimic the functionality via middleware as follows:

      use Psr\Http\Message\ResponseInterface;
      use Psr\Http\Message\ServerRequestInterface;
      use Psr\Http\Server\RequestHandlerInterface;
      use Zend\Diactoros\Uri;
      
      public function process(ServerRequestInterface $request, RequestHandlerInterface $handler) : ResponseInterface
      {
          $requestUri = null;
      
          $httpXRewriteUrl = $request->getHeaderLine('X-Rewrite-Url');
          if ($httpXRewriteUrl !== null) {
              $requestUri = $httpXRewriteUrl;
          }
      
          $httpXOriginalUrl = $request->getHeaderLine('X-Original-Url');
          if ($httpXOriginalUrl !== null) {
              $requestUri = $httpXOriginalUrl;
          }
      
          if ($requestUri !== null) {
              $request = $request->withUri(new Uri($requestUri));
          }
      
          return $handler->handle($request);
      }
      

      If you use middleware such as the above, make sure you also instruct your web server to strip any incoming headers of the same name so that you can guarantee they are issued by the ISAPI_Rewrite module.

    Deprecated

    • Nothing.

    Removed

    • Nothing.

    Fixed

    • Nothing.
    Source code(tar.gz)
    Source code(zip)
  • 1.8.3(Jul 24, 2018)

    Added

    • Nothing.

    Changed

    • Nothing.

    Deprecated

    • Nothing.

    Removed

    • Nothing.

    Fixed

    • #321 updates the logic in Uri::withPort() to ensure that it checks that the value provided is either an integer or a string integer, as only those values may be cast to integer without data loss.

    • #320 adds checking within Response to ensure that the provided reason phrase is a string; an InvalidArgumentException is now raised if it is not. This change ensures the class adheres strictly to the PSR-7 specification.

    • #319 provides a fix to Zend\Diactoros\Response that ensures that the status code returned is always an integer (and never a string containing an integer), thus ensuring it strictly adheres to the PSR-7 specification.

    Source code(tar.gz)
    Source code(zip)
  • 1.8.2(Jul 19, 2018)

    Added

    • Nothing.

    Changed

    • Nothing.

    Deprecated

    • Nothing.

    Removed

    • Nothing.

    Fixed

    • #318 fixes the logic for discovering whether an HTTPS scheme is in play to be case insensitive when comparing header and SAPI values, ensuring no false negative lookups occur.

    • #314 modifies error handling around opening a file resource within Zend\Diactoros\Stream::setStream() to no longer use the second argument to set_error_handler(), and instead check the error type in the handler itself; this fixes an issue when the handler is nested inside another error handler, which currently has buggy behavior within the PHP engine.

    Source code(tar.gz)
    Source code(zip)
  • 1.8.1(Jul 9, 2018)

    Added

    • Nothing.

    Changed

    • #313 changes the reason phrase associated with the status code 425 to "Too Early", corresponding to a new definition of the code as specified by the IANA.

    Deprecated

    • Nothing.

    Removed

    • Nothing.

    Fixed

    • #312 fixes how the normalizeUploadedFiles() utility function handles nested trees of uploaded files, ensuring it detects them properly.
    Source code(tar.gz)
    Source code(zip)
  • 1.8.0(Jun 27, 2018)

    Added

    • #307 adds the following functions under the Zend\Diactoros namespace, each of which may be used to derive artifacts from SAPI supergloabls for the purposes of generating a ServerRequest instance:
      • normalizeServer(array $server, callable $apacheRequestHeaderCallback = null) : array (main purpose is to aggregate the Authorization header in the SAPI params when under Apache)
      • marshalProtocolVersionFromSapi(array $server) : string
      • marshalMethodFromSapi(array $server) : string
      • marshalUriFromSapi(array $server, array $headers) : Uri
      • marshalHeadersFromSapi(array $server) : array
      • parseCookieHeader(string $header) : array
      • createUploadedFile(array $spec) : UploadedFile (creates the instance from a normal $_FILES entry)
      • normalizeUploadedFiles(array $files) : UploadedFileInterface[] (traverses a potentially nested array of uploaded file instances and/or $_FILES entries, including those aggregated under mod_php, php-fpm, and php-cgi in order to create a flat array of UploadedFileInterface instances to use in a request)

    Changed

    • Nothing.

    Deprecated

    • #307 deprecates ServerRequestFactory::normalizeServer(); the method is no longer used internally, and users should instead use Zend\Diactoros\normalizeServer(), to which it proxies.

    • #307 deprecates ServerRequestFactory::marshalHeaders(); the method is no longer used internally, and users should instead use Zend\Diactoros\marshalHeadersFromSapi(), to which it proxies.

    • #307 deprecates ServerRequestFactory::marshalUriFromServer(); the method is no longer used internally. Users should use marshalUriFromSapi() instead.

    • #307 deprecates ServerRequestFactory::marshalRequestUri(). the method is no longer used internally, and currently proxies to marshalUriFromSapi(), pulling the discovered path from the Uri instance returned by that function. Users should use marshalUriFromSapi() instead.

    • #307 deprecates ServerRequestFactory::marshalHostAndPortFromHeaders(); the method is no longer used internally, and currently proxies to marshalUriFromSapi(), pulling the discovered host and port from the Uri instance returned by that function. Users should use marshalUriFromSapi() instead.

    • #307 deprecates ServerRequestFactory::getHeader(); the method is no longer used internally. Users should copy and paste the functionality into their own applications if needed, or rely on headers from a fully-populated Uri instance instead.

    • #307 deprecates ServerRequestFactory::stripQueryString(); the method is no longer used internally, and users can mimic the functionality via the expression $path = explode('?', $path, 2)[0];.

    • #307 deprecates ServerRequestFactory::normalizeFiles(); the functionality is no longer used internally, and users can use normalizeUploadedFiles() as a replacement.

    • #303 deprecates Zend\Diactoros\Response\EmitterInterface and its various implementations. These are now provided via the zendframework/zend-httphandlerrunner package as 1:1 substitutions.

    • #303 deprecates the Zend\Diactoros\Server class. Users are directed to the RequestHandlerRunner class from the zendframework/zend-httphandlerrunner package as an alternative.

    Removed

    • Nothing.

    Fixed

    • Nothing.
    Source code(tar.gz)
    Source code(zip)
  • 1.7.2(May 29, 2018)

    Added

    • Nothing.

    Changed

    • Nothing.

    Deprecated

    • Nothing.

    Removed

    • Nothing.

    Fixed

    • #301 adds stricter comparisons within the uri class to ensure non-empty values are not treated as empty.
    Source code(tar.gz)
    Source code(zip)
  • 1.7.1(Feb 26, 2018)

    Added

    • Nothing.

    Changed

    • #293 updates Uri::getHost() to cast the value via strtolower() before returning it. While this represents a change, it is fixing a bug in our implementation: the PSR-7 specification for the method, which follows IETF RFC 3986 section 3.2.2, requires that the host name be normalized to lowercase.

    Deprecated

    • Nothing.

    Removed

    • Nothing.

    Fixed

    • #290 fixes Stream::getSize() such that it checks that the result of fstat was succesful before attempting to return its size member; in the case of an error, it now returns null.
    Source code(tar.gz)
    Source code(zip)
  • 1.7.0(Jan 4, 2018)

    Added

    • #285 adds a new custom response type, Zend\Diactoros\Response\XmlResponse, for generating responses representing XML. Usage is the same as with the HtmlResponse or TextResponse; the response generated will have a Content-Type: application/xml header by default.

    • #280 adds the response status code/phrase pairing "103 Early Hints" to the Response::$phrases property. This is a new status proposed via RFC 8297.

    • #279 adds explicit support for PHP 7.2; previously, we'd allowed build failures, though none occured; we now require PHP 7.2 builds to pass.

    Changed

    • Nothing.

    Deprecated

    • Nothing.

    Removed

    • Nothing.

    Fixed

    • Nothing.
    Source code(tar.gz)
    Source code(zip)
  • 1.6.1(Oct 12, 2017)

    Added

    • Nothing.

    Changed

    • #273 updates each of the SAPI emitter implementations to emit the status line after emitting other headers; this is done to ensure that the status line is not overridden by PHP.

    Deprecated

    • Nothing.

    Removed

    • Nothing.

    Fixed

    • #273 modifies how the SapiEmitterTrait calls header() to ensure that a response code is always passed as the third argument; this is done to prevent PHP from silently overriding it.
    Source code(tar.gz)
    Source code(zip)
  • 1.6.0(Sep 13, 2017)

    Added

    • Nothing.

    Changed

    • #270 changes the behavior of Zend\Diactoros\Server: it no longer creates an output buffer.

    • #270 changes the behavior of the two SAPI emitters in two backwards-incompatible ways:

      • They no longer auto-inject a Content-Length header. If you need this functionality, zendframework/zend-expressive-helpers 4.1+ provides it via Zend\Expressive\Helper\ContentLengthMiddleware.

      • They no longer flush the output buffer. Instead, if headers have been sent, or the output buffer exists and has a non-zero length, the emitters raise an exception, as mixed PSR-7/output buffer content creates a blocking issue. If you are emitting content via echo, print, var_dump, etc., or not catching PHP errors or exceptions, you will need to either fix your application to always work with a PSR-7 response, or provide your own emitters that allow mixed output mechanisms.

    Deprecated

    • Nothing.

    Removed

    • Nothing.

    Fixed

    • Nothing.
    Source code(tar.gz)
    Source code(zip)
  • 1.5.0(Aug 22, 2017)

    Added

    • #205 adds support for PHP 7.2.

    • #250 adds a new API to JsonResponse to avoid the need for decoding the response body in order to make changes to the underlying content. New methods include:

      • getPayload(): retrieve the unencoded payload.
      • withPayload($data): create a new instance with the given data.
      • getEncodingOptions(): retrieve the flags to use when encoding the payload to JSON.
      • withEncodingOptions(int $encodingOptions): create a new instance that uses the provided flags when encoding the payload to JSON.

    Changed

    • #249 changes the behavior of the various Uri::with*() methods slightly: if the value represents no change, these methods will return the same instance instead of a new one.

    • #248 changes the behavior of Uri::getUserInfo() slightly: it now (correctly) returns the percent-encoded values for the user and/or password, per RFC 3986 Section 3.2.1. withUserInfo() will percent-encode values, using a mechanism that prevents double-encoding.

    • #243 changes the exception messages thrown by UploadedFile::getStream() and moveTo() when an upload error exists to include details about the upload error.

    • #233 adds a new argument to SapiStreamEmitter::emit, $maxBufferLevel between the $response and $maxBufferLength arguments. This was done because the Server::listen() method passes only the response and $maxBufferLevel to emitters; previously, this often meant that streams were being chunked 2 bytes at a time versus the expected default of 8kb.

      If you were calling the SapiStreamEmitter::emit() method manually previously, you will need to update your code.

    Deprecated

    • Nothing.

    Removed

    • #205 and #243 remove support for PHP versions prior to 5.6 as well as HHVM.

    Fixed

    • #248 fixes how the Uri class provides user-info within the URI authority; the value is now correctly percent-encoded , per RFC 3986 Section 3.2.1.
    Source code(tar.gz)
    Source code(zip)
  • 1.4.1(Aug 17, 2017)

    Added

    • Nothing.

    Deprecated

    • Nothing.

    Removed

    • #260 removes support for HHVM, as tests have failed against it for some time.

    Fixed

    • #247 fixes the Stream and RelativeStream __toString() method implementations to check if the stream isSeekable() before attempting to rewind() it, ensuring that the method does not raise exceptions (PHP does not allow exceptions in that method). In particular, this fixes an issue when using AWS S3 streams.

    • #252 provides a fix to the SapiEmitterTrait to ensure that any Set-Cookie headers in the response instance do not override those set by PHP when a session is created and/or regenerated.

    • #257 provides a fix for the PhpInputStream::read() method to ensure string content that evaluates as empty (including 0) is still cached.

    • #258 updates the Uri::filterPath() method to allow parens within a URI path, per RFC 3986 section 3.3 (parens are within the character set "sub-delims").

    Source code(tar.gz)
    Source code(zip)
  • 1.4.0(Apr 6, 2017)

    Added

    • #219 adds two new classes, Zend\Diactoros\Request\ArraySerializer and Zend\Diactoros\Response\ArraySerializer. Each exposes the static methods toArray() and fromArray(), allowing de/serialization of messages from and to arrays.

    • #236 adds two new constants to the Response class: MIN_STATUS_CODE_VALUE and MAX_STATUS_CODE_VALUE.

    Changes

    • #240 changes the behavior of ServerRequestFactory::fromGlobals() when no $cookies argument is present. Previously, it would use $_COOKIES; now, if a Cookie header is present, it will parse and use that to populate the instance instead.

      This change allows utilizing cookies that contain period characters (.) in their names (PHP's built-in cookie handling renames these to replace . with _, which can lead to synchronization issues with clients).

    • #235 changes the behavior of Uri::__toString() to better follow proscribed behavior in PSR-7. In particular, prior to this release, if a scheme was missing but an authority was present, the class was incorrectly returning a value that did not include a // prefix. As of this release, it now does this correctly.

    Deprecated

    • Nothing.

    Removed

    • Nothing.

    Fixed

    • Nothing.
    Source code(tar.gz)
    Source code(zip)
  • 1.3.11(Apr 6, 2017)

    Added

    • Nothing.

    Changes

    • #241 changes the constraint by which the package provides psr/http-message-implementation to simply 1.0 instead of ~1.0.0, to follow how other implementations provide PSR-7.

    Deprecated

    • Nothing.

    Removed

    • Nothing.

    Fixed

    • #161 adds additional validations to header names and values to ensure no malformed values are provided.

    • #234 fixes a number of reason phrases in the Response instance, and adds automation from the canonical IANA sources to ensure any new phrases added are correct.

    Source code(tar.gz)
    Source code(zip)
  • 1.3.10(Jan 23, 2017)

    Added

    • Nothing.

    Deprecated

    • Nothing.

    Removed

    • Nothing.

    Fixed

    • #226 fixed an issue with the SapiStreamEmitter causing the response body to be cast to (string) and also be read as a readable stream, potentially producing double output.
    Source code(tar.gz)
    Source code(zip)
Owner
Zend Framework
Zend Framework
Finds installed HTTPlug implementations and PSR-7 message factories.

Finds installed HTTPlug implementations and PSR-7 message factories.

The PHP HTTP group 1.1k Dec 29, 2022
HTTP header kit for PHP 7.1+ (incl. PHP 8) based on PSR-7

HTTP header kit for PHP 7.1+ (incl. PHP 8) based on PSR-7 Installation composer require sunrise/http-header-kit How to use? HTTP Header Collection Mor

Sunrise // PHP 63 Dec 31, 2022
Simple HTTP cURL client for PHP 7.1+ based on PSR-18

Simple HTTP cURL client for PHP 7.1+ based on PSR-18 Installation composer require sunrise/http-client-curl QuickStart composer require sunrise/http-f

Sunrise // PHP 15 Sep 5, 2022
A super lightweight PSR-7 implementation

PSR-7 implementation A super lightweight PSR-7 implementation. Very strict and very fast. Description Guzzle Laminas Slim Nyholm Lines of code 3.300 3

Tobias Nyholm 972 Jan 5, 2023
Declarative HTTP Clients using Guzzle HTTP Library and PHP 8 Attributes

Waffler How to install? $ composer require waffler/waffler This package requires PHP 8 or above. How to test? $ composer phpunit Quick start For our e

Waffler 3 Aug 26, 2022
Event-driven, streaming HTTP client and server implementation for ReactPHP

HTTP Event-driven, streaming HTTP client and server implementation for ReactPHP. This HTTP library provides re-usable implementations for an HTTP clie

ReactPHP 640 Dec 29, 2022
Guzzle, an extensible PHP HTTP client

Guzzle, PHP HTTP client Guzzle is a PHP HTTP client that makes it easy to send HTTP requests and trivial to integrate with web services. Simple interf

Guzzle 22.3k Jan 2, 2023
Requests for PHP is a humble HTTP request library. It simplifies how you interact with other sites and takes away all your worries.

Requests for PHP Requests is a HTTP library written in PHP, for human beings. It is roughly based on the API from the excellent Requests Python librar

null 3.5k Dec 31, 2022
A Chainable, REST Friendly, PHP HTTP Client. A sane alternative to cURL.

Httpful Httpful is a simple Http Client library for PHP 7.2+. There is an emphasis of readability, simplicity, and flexibility – basically provide the

Nate Good 1.7k Dec 21, 2022
PHP's lightweight HTTP client

Buzz - Scripted HTTP browser Buzz is a lightweight (<1000 lines of code) PHP 7.1 library for issuing HTTP requests. The library includes three clients

Kris Wallsmith 1.9k Jan 4, 2023
HTTPlug, the HTTP client abstraction for PHP

HTTPlug HTTPlug, the HTTP client abstraction for PHP. Intro HTTP client standard built on PSR-7 HTTP messages. The HTTPlug client interface is compati

The PHP HTTP group 2.4k Dec 30, 2022
Record your test suite's HTTP interactions and replay them during future test runs for fast, deterministic, accurate tests.

This is a port of the VCR Ruby library to PHP. Record your test suite's HTTP interactions and replay them during future test runs for fast, determinis

php-vcr 1.1k Dec 23, 2022
Requests for PHP is a humble HTTP request library. It simplifies how you interact with other sites and takes away all your worries.

Requests for PHP Requests is a HTTP library written in PHP, for human beings. It is roughly based on the API from the excellent Requests Python librar

null 3.5k Dec 31, 2022
The HttpClient component provides powerful methods to fetch HTTP resources synchronously or asynchronously.

HttpClient component The HttpClient component provides powerful methods to fetch HTTP resources synchronously or asynchronously. Resources Documentati

Symfony 1.7k Jan 6, 2023
Unirest in PHP: Simplified, lightweight HTTP client library.

Unirest for PHP Unirest is a set of lightweight HTTP libraries available in multiple languages, built and maintained by Mashape, who also maintain the

Kong 1.3k Dec 28, 2022
PHP Curl Class makes it easy to send HTTP requests and integrate with web APIs

PHP Curl Class: HTTP requests made easy PHP Curl Class makes it easy to send HTTP requests and integrate with web APIs. Installation Requirements Quic

null 3.1k Jan 5, 2023
The HttpFoundation component defines an object-oriented layer for the HTTP specification.

HttpFoundation Component The HttpFoundation component defines an object-oriented layer for the HTTP specification. Resources Documentation Contributin

Symfony 8.3k Dec 29, 2022
↪️ Bypass for PHP creates a custom HTTP Server to return predefined responses to client requests

Bypass for PHP provides a quick way to create a custom HTTP Server to return predefined responses to client requests.Useful for tests with Pest PHP or PHPUnit.

CiaReis 101 Dec 1, 2022
Application for logging HTTP and DNS Requests

Request Logger Made by Adam Langley ( https://twitter.com/adamtlangley ) What is it? Request logger is a free and open source utility for logging HTTP

null 13 Nov 28, 2022