Yii Framework Forum: Can't receive http post request - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Can't receive http post request

#1 User is offline   SteveM 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 80
  • Joined: 26-October 15
  • Location:Navan, Ireland

Posted 05 March 2018 - 07:31 PM

I've set up a Mailchimp webhook, which sends a post request everytime a campaign is sent. The problem is, I can't get my action to receive the post request. On initial setup of the webhook, Mailchimp sends a get request to validate the url. I can receive the get request just fine, but not the post request when the send campaign event is triggered. I'm using RequestBin and I can see that the webhook is functioning correctly and posting the requested data. Why won't my application receive it? It's running on Apache/Ubuntu server, and I've read several Apache forums which state that nothing special is required to receive http post requests. I've verified that I'm not blocking it in .htaccess. Any ideas what might be blocking it?
0

#2 User is offline   alrazi 

  • Elite Member
  • Yii
  • Group: Moderators
  • Posts: 1,546
  • Joined: 08-August 12
  • Location:Durban, South Africa

Posted 06 March 2018 - 12:51 AM

I would suggest you investigate the logs and inspect where in the pipeline your request is being dropped, maybe its hitting an endpoint which is not registered as a yii route so check nginx logs as well as app logs under runtime/logs/app.log
0

#3 User is offline   Silvio Porcellana 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 10
  • Joined: 31-January 18

Posted 06 March 2018 - 04:41 AM

Did you check/disable CSRF?

https://yii2-cookboo...hedocs.io/csrf/
0

#4 User is offline   SteveM 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 80
  • Joined: 26-October 15
  • Location:Navan, Ireland

Posted 06 March 2018 - 06:54 AM

CSRF was not disabled for the action, but it is now. :-)

It's still not working. There's nothing recent (from the last day of testing) in the runtime app.log. I'm checking into how to view request logs on Apache.
0

#5 User is offline   SteveM 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 80
  • Joined: 26-October 15
  • Location:Navan, Ireland

Posted 06 March 2018 - 08:25 AM

It's fixed! I didn't have the error logging configured properly. I found a simple error in the action. The solution was a combination of CSRF and detecting the error. Thanks to both of you!
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users