0

If i dont specify php file when i call url, $_POST is empty.
For example:

with this code:

<?php
var_dump($_POST);

if i call like this(with some post params): http://domain.com/api.json
response is:

array(0) {
}

If i call like this: http://domain.com/api.json/index.php

array(1) {
  ["param"]=>
  string(4) "test"
}

I assume that it is something with the server configuration, but i dont know exactly what
I want to be able to not specify php file in my api calls

EDIT:
Response Headers:

Connection → Keep-Alive  
Content-Encoding → gzip  
Content-Length → 92  
Content-Type → application/json, text/html  
Date → Sun, 22 Feb 2015 12:19:03 GMT  
Keep-Alive → timeout=5, max=99  
Server → Apache  
Vary → Accept-Encoding  
X-Powered-By → PleskLin
pedja
  • 3,285
  • 5
  • 36
  • 48
  • What are the HTTP headers that you receive from `http://domain.com/api.json`? – tsnorri Feb 22 '15 at 12:17
  • Added headers in question. If i specify index.php, headers are the same – pedja Feb 22 '15 at 12:19
  • 1
    "i dont know exactly what i want to be able", you should.. – Kerem Feb 22 '15 at 12:25
  • I was thinking that the user agent [might change the HTTP method](http://stackoverflow.com/questions/2068418/whats-the-difference-between-a-302-and-a-307-redirect) if the original response contained a `Location` header. If this is not the case, how is your server configured to execute the PHP script? Apache's `LocationMatch` or something similar? – tsnorri Feb 22 '15 at 12:27
  • @tsnorri I honestly have no idea, im using plesk, how can i check that? – pedja Feb 22 '15 at 12:29

0 Answers0