httpsoft / http-message Goto Github PK
View Code? Open in Web Editor NEWStrict and fast implementation of PSR-7 and PSR-17
Home Page: https://httpsoft.org/docs/message
License: MIT License
Strict and fast implementation of PSR-7 and PSR-17
Home Page: https://httpsoft.org/docs/message
License: MIT License
Description
See comment a01ec15#r78665198
Maybe I'm wrong, but everything works in guzzle and Nyholm, but not here (((
Possible solution
"r+" mode is needed , otherwise content is empty
Additional info
Q | A |
---|---|
Package version | 1.0.9 |
PHP version | 8.0 |
Operating system | Ubuntu |
Parsed body always null, but by PSR-7 in certain cases, it must contain certain values:
If the request Content-Type is either application/x-www-form-urlencoded
or multipart/form-data, and the request method is POST, this method MUST
return the contents of $_POST.
Otherwise, this method may return any results of deserializing
the request body content; as parsing returns structured content, the
potential types MUST be arrays or objects only. A null value indicates
the absence of body content.
Hello there!
My name is Ana. I noted that you use the mutation testing tool infection in the project.
I am a postdoctoral researcher at the University of Seville (Spain), and my colleagues and I are studying how mutation testing tools are used in practice. With this aim in mind, we have analysed over 3,500 public GitHub repositories using mutation testing tools, including yours! This work has recently been published in a journal paper available at https://link.springer.com/content/pdf/10.1007/s10664-022-10177-8.pdf.
To complete this study, we are asking for your help to understand better how mutation testing is used in practice, please! We would be extremely grateful if you could contribute to this study by answering a brief survey of 21 simple questions (no more than 6 minutes). This is the link to the questionnaire https://forms.gle/FvXNrimWAsJYC1zB9.
Drop me an e-mail if you have any questions or comments ([email protected]). Thank you very much in advance!!
Description
If I instantiate a Response: $response = new Response(200, [], 'my value');
when I look into the body stream (string) $response->getBody();
, there is no string 'my value'.
Description
$streamFactory->createStreamFromFile('', 'r');
throw InvalidArgumentException
, but should RuntimeException
by PSR-17.
Additional info
Q | A |
---|---|
Package version | 1.0.4 |
PHP version | 7.4 |
Operating system | Win10 |
I compiled this list of tests for http-message spec: https://github.com/hamlet-framework/http-message-spec
The tests are kept as traits, so it shouldn't be a problem to reuse in your project if the need arises. In any case, there are few issues, feel free to check out the latest master and run all tests/HttpSoft*
for more details. One notable issue is how you handle Host
header.
Also, my benchmark results look quite different from yours:
Comprehensive test
+----------------------+--------------------+-------------------+--------------+
| Function description | Execution time (s) | Memory usage (mb) | Times faster |
+----------------------+--------------------+-------------------+--------------+
| ring-central | 4.0299 | 0.0970 | 14% |
| nyholm | 4.5991 | 0.1470 | 12% |
| guzzle | 5.1903 | 0.3000 | 13% |
| hamlet-framework | 5.8748 | 0.3160 | 31% |
| zend-diactoros | 7.6987 | 0.1780 | 3% |
| http-soft | 7.9331 | 0.1530 | 25% |
| wind-walker | 9.9951 | 0.3440 | 0 |
+----------------------+--------------------+-------------------+--------------+
Fetching test
+----------------------+--------------------+-------------------+--------------+
| Function description | Execution time (s) | Memory usage (mb) | Times faster |
+----------------------+--------------------+-------------------+--------------+
| hamlet-framework | 1.7709 | 0.0000 | 17% |
| ring-central | 2.0741 | 0.0000 | 3% |
| nyholm | 2.1567 | 0.0000 | 4% |
| guzzle | 2.2612 | 0.0000 | 44% |
| zend-diactoros | 3.2708 | 0.0010 | 12% |
| wind-walker | 3.6730 | 0.0010 | 6% |
| http-soft | 3.9247 | 0.0000 | 0 |
+----------------------+--------------------+-------------------+--------------+
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.