psr-7 Questions

3

Solved

I am updating my project from PHP 7.0 to PHP 8.0 and I couldn't find out, if it is allowed to EXPLICITLY assign resource as the data type: of a class property, of a method/function parameter, retu...
Alfonzoalford asked 30/3, 2021 at 13:8

2

Solved

Scenario 1 sending x-www-form-urlencoded data POST /path HTTP/1.1 Content-Type: application/x-www-form-urlencoded foo=bar Running print_r($request->getParsedBody()); returns fine: Array ( ...
Liesa asked 6/2, 2020 at 18:54

2

I'm implementing a service using Slim 4 framework which will pretty much always be returning JSON responses. I'm trying to keep all of the responses uniform with a structure similar to this: { &qu...
Mugger asked 12/11, 2021 at 19:26

7

Solved

I've been searching for about 2 hours and I can't figure it out how to read the final response uri. In previous versions of PHP Guzzle you just call $response->getEffectiveUrl() and you get it....
Firstrate asked 6/6, 2015 at 11:31

3

Solved

I've got an issue for laravel 5.4 when I trying to using guzzleHttp. here is my code. use GuzzleHttp\Client; $url = 'http://example.com'; $client = new Client(); $parameter = ['query' => ['nam...
Benefactor asked 7/6, 2017 at 4:30

4

Solved

I am trying to build a dynamic drop-down menu from routes defined in Slim framework and here is my question - is there a way to access all defined static routes from some kind of array? For instan...
Tasty asked 9/11, 2016 at 11:10

4

Solved

How I can get all get/ put/ post variables like in Slim 2 for Slim 3? Slim 2, $allGetVars = $app->request->get(); $allPutVars = $app->request->put(); $allPostVars = $app->request-&...
Emmanuelemmeline asked 19/9, 2015 at 12:25

3

Solved

I know that I can create a PHP stream from a filename (a real one, or an URL), by using the fopen function: $stream = fopen('php://temp', 'r'); The resulting stream ($stream) is then a resource of...
Llanes asked 30/3, 2018 at 12:50

2

I'm trying to understand how PSR-7 works and I get stuck! Here is my code: $app->get('/', function () { $stream = new Stream('php://memory', 'rw'); $stream->write('Foo'); $response = (new...
Mind asked 23/10, 2015 at 14:25

3

Solved

I try to find the right way to check, in a CASE-INSENSITIVE manner, if an array key exists. I have an array - a list of HTTP headers: $headers = [ 'User-Agent' => 'Mozilla', ]; Basically, I...
School asked 16/9, 2017 at 17:48

2

Solved

I was wondering if someone could explain to me the meaning of a Server-Side Request. It might just be the terminology I don't quite get. To me it sounds like a request from the server to the client...
Insecure asked 13/10, 2016 at 2:13

1

Solved

i have been using slim 3 and finally got my head around psr-7. Now working with laravel i see that out of the box, psr-7 is not supported. Now... is there a strong reason to follow psr-7 or the la...
Adventure asked 15/8, 2016 at 23:36

2

Solved

It is either not being sent, or not being received correctly. Using curl direct from the command line (using the -d option) or from PHP (using CURLOPT_POSTFIELDS) does work. I start with a PSR-7 r...
Dominations asked 3/1, 2016 at 13:57

2

Solved

In Slim 2, I can over write the default 404 page easily, // @ref: http://help.slimframework.com/discussions/problems/4400-templatespath-doesnt-change $app->notFound(function () use ($app) { $v...
Alligator asked 19/9, 2015 at 12:21

1

Solved

I am looking at the PSR-7 interfaces and thinking of a way on how to implement them. I've also been reading this blog post. Apparently the objects that implement the PSR-7 interfaces must be immut...
Hecklau asked 11/7, 2015 at 19:7
1

© 2022 - 2025 — McMap. All rights reserved.