Questions tagged [psr-7]

PSR-7 is the FIG standard for HTTP messages in PHP. It provides abstractions of HTTP messages and their components and defines a consistent set of interfaces to work with them.

The purpose of PSR-7 is to provide PHP with a set of common interfaces for HTTP messages as described in RFC 7230 and RFC 7231, and URIs as described in RFC 3986 (in the context of HTTP messages).

All HTTP messages consist of the HTTP protocol version being used, headers, and a message body. A Request builds on the message to include the HTTP method used to make the request, and the URI to which the request is made. A Response includes the HTTP status code and reason phrase.

In PHP, HTTP messages are used in two contexts:

  • To send an HTTP request, via the ext/curl extension, PHP's native stream layer, etc., and process the received HTTP response. In other words, HTTP messages are used when using PHP as an HTTP client.
  • To process an incoming HTTP request to the server, and return an HTTP response to the client making the request. PHP can use HTTP messages when used as a server-side application to fulfil HTTP requests.
94 questions
0
votes
2 answers

Zend\Http\Client as PSR-7 middleware for Zend Expressive

How should we add Zend\Http\Client (or other modules) as PSR-7 middleware? First i thought was: Case an Action add factory inject Zend\Http\Client instance use Zend\Http\Client instance in Action like $client->request('GET'); But im not sure if…
cottton
  • 1,522
  • 14
  • 29
0
votes
2 answers

PSR7 Request: Get request data like $_REQUEST in Slim3

I am refactoring my application using PSR-7 Requests using Slim3 as Router. On some of my entry points I have incoming GET and POST HTTP-Requests from external applications. Both GET and POST use the same parameter names. In the old code, a simple…
Trendfischer
  • 7,112
  • 5
  • 40
  • 51
0
votes
1 answer

Transform PSR-7 response to Symfony response

I have written an own HTTP library that implements the PSR-7 interfaces. I use this library in a second library that does some business logic and may return either a response or request in PSR-7 standard. For my application I use Silex / Symfony…
Cravid
  • 653
  • 2
  • 7
  • 22
0
votes
1 answer

How to disable URL encoding in Guzzle 6

I'm working with pipedrive API and I want to make such a request: GET https://api.pipedrive.com/v1/deals(id,title,value,currency)?api_token=YOUR_API_TOKEN It works fine eg. when I do the request with a browser, but when I send the request with…
Isinlor
  • 1,111
  • 1
  • 13
  • 22
1 2 3 4 5 6
7