Giter Club home page Giter Club logo

Comments (10)

 avatar commented on May 21, 2024

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.

kamov avatar kamov commented on May 21, 2024

@christianschuit I have already all data from POST using $this->data

from core.

 avatar commented on May 21, 2024

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.

 avatar commented on May 21, 2024

Anyone?

from core.

mateuszgachowski avatar mateuszgachowski commented on May 21, 2024

Whats your .htaccess and what server?

from core.

 avatar commented on May 21, 2024

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.

rizqyhi avatar rizqyhi commented on May 21, 2024

hi,
any news on this? i've got the similar problem. fyi, i'm calling it via ajax.

from core.

mikecao avatar mikecao commented on May 21, 2024

@christianschuit can you do a var_dump of the $_GET and $_POST as well?

from core.

mateuszgachowski avatar mateuszgachowski commented on May 21, 2024

@christianschuit and maybe the request dump (Request Headers and Response, from e.g. Chrome Web Developer Tools)

from core.

davidbielik avatar davidbielik commented on May 21, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.