cross domain request error in IE
above all, thank you for providing us this wonderful library. i have an issue with cross domain request. when i try to request php rest server from another domain, allowed header error occurs only with internet explorer browser(version 11).
SEC7123: Request header content-type was not present in the Access-Control-Allow-Headers list.
SCRIPT7002: SCRIPT7002: XMLHttpRequest: Network Error 0x2ef3, Could not complete the operation due to error
the only solution for this error was paste below code into REST_Controller.php source. at the initial part of constructor.
header('Access-Control-Allow-Origin: *');
header("Access-Control-Allow-Headers: X-API-KEY, Origin, X-Requested-With, Content-Type, Accept, Access-Control-Request-Method");
header("Access-Control-Allow-Methods: GET, POST, OPTIONS, PUT, DELETE");
$method = $_SERVER['REQUEST_METHOD'];
if($method == "OPTIONS") {
die();
}
i expected cross domain logic in REST_Controller.php and rest.php works properly, because everything look so fine. ex) $config['allow_any_cors_domain'] = TRUE; but it doesn't.
please review this issue. thanks. sorry for poor english.
Your English is fine :)
I'll take a look.
How to call delete request what is the url for that
For the delete Request you need to send DELETE instead of POST, GET or PUT
Regarding CORS issue with IE, I had the same problem and solve it using xdomain. I don't use restserver's feature for that.
Not sure, but this issue might have been fixed with commit 4c8a9c3fa0c07d930f3b04ce8ab6e1905dfa8006 ... maybe we should test again with IE.
Gave it a test, and I didn't have any issues with Edge. Going to close this. Feel free to re-open if there is a problem with IE11