0

I have public function reciveNotification() and it is alowded as following

$this->Auth->allow([“reciveNotification”]);

When I do GET Request it working good but by POST request I am facing to 403 Forbidden what am I doing wrong?

GET:
HTTP/1.1 200 OK
Date: Wed, 24 Apr 2019 11:06:43 GMT
Server: Apache/2.4.29 (Ubuntu)
Content-Length: 0
Content-Type: text/html; charset=UTF-8

POST:
HTTP/1.1 403 Forbidden
Date: Wed, 24 Apr 2019 11:05:52 GMT
Server: Apache/2.4.29 (Ubuntu)
Content-Length: 836
Content-Type: text/html; charset=UTF-8
Cœur
  • 37,241
  • 25
  • 195
  • 267
  • Enable debug mode and check the error logs. Also those quotes aren't valid. – ndm Apr 24 '19 at 13:09
  • I have tried to turn off debug and i got Missing CSRF token cookie – Hamed Rahimi Apr 25 '19 at 12:28
  • There you go... if your API doesn't require CSRF protection (which is likely), then you'll have to disable it (possibly only partially if your app isn't API only), see **https://stackoverflow.com/questions/51931406/post-requests-for-cakephp-3-api-are-not-working**. – ndm Apr 25 '19 at 12:35

0 Answers0