Comments (10)
And, in working with PHP, there are other incoming POST data sets that seem not to work with Flight..
I have updated my copy of the Request object with the below method to ensure $this->data contains ALL post data:
/**
* Custom data collect function
*/
private function getData() {
// Get post stream first
$post = array();
parse_str(file_get_contents('php://input'), $post);
// Then add POST data
foreach ($_POST as $key=>$value) {
$post[$key] = $value;
}
return $post;
}
And in the constructor:
'data' => new Collection($this->getData()),
from core.
@christianschuit I have already all data from POST using $this->data
from core.
Guys, I keep getting stuck on this and a similar problem. Both my "data" on POST and my "query" on GET remain empty..?
When dumping the Flight::request() response, I have the following. You can see the params in the URL and the empty query. Am I doing something wrong here?
"url": "/categories?psize=10",
"base": "/solutions/MiioMobile",
"method": "GET",
"referrer": "",
"ip": "10.0.2.2",
"ajax": false,
"scheme": "HTTP/1.1",
"user_agent": "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:23.0) Gecko/20100101 Firefox/23.0",
"body": "",
"type": "",
"length": 0,
"query": {},
"data": {},
"cookies": {},
"files": {},
"secure": false,
"accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8",
"proxy_ip": ""
Calling the URL directly from my Firefox browser..
from core.
Anyone?
from core.
Whats your .htaccess and what server?
from core.
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php [QSA,L]
Apache HTTP server with PHP 5.3.3
from core.
hi,
any news on this? i've got the similar problem. fyi, i'm calling it via ajax.
from core.
@christianschuit can you do a var_dump of the $_GET and $_POST as well?
from core.
@christianschuit and maybe the request dump (Request Headers and Response, from e.g. Chrome Web Developer Tools)
from core.
For anyone experiencing a similar issue, something like this might help (before Flight's code) in index.php:
try{
$_POST = (array) json_decode(urldecode(file_get_contents("php://input")));
}catch(Exception $e){
}
from core.
Related Issues (20)
- Possible deployment on AWS Lambda. HOT 1
- Possible way to include some shorthand helpers or utils. HOT 12
- Documentation on how to Docker-ize FlightPHP application. HOT 1
- Notice: Event 'notFound' has been overridden! HOT 5
- Minifier html HOT 3
- Handling of URLs with encoded slashes (/)
- Have URL parameters available when setting streaming headers HOT 2
- Upgrade from 3.2.0 to 3.6.1 breaks Flight::json ? HOT 2
- [Docs > Routing] Method Routing HOT 6
- [Refactor] Flight::get() need to be renamed HOT 2
- [Views] register method : no autocomplete / intelsense HOT 3
- get_input_data HOT 3
- Comments before begin php tag returns json with garbage HOT 4
- FYI, minor bug with streamWithHeaders() HOT 11
- Multiple renders keeps the previous state When I render multiple views as components, they keep the state of previous arguments passed to them instead of reinitialize with default value each render.
- Inject Middleware constructor arguments using the DI Container HOT 4
- Proposal of compact syntax for Flight::route HOT 7
- View class steroids 🙌🏽 HOT 1
- How to stop the request process when there is an issue in the Middleware? HOT 7
- Named Parameters Are Actually In Order... HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from core.