I'm using Mandrill to send email and I need to track the emails' statuses. Mandrill use Webhooks to send a POST request to a specific url to notify when an event happens.

I'm using Services to implement the webservice to get that information. However, before sending a POST request, Mandrill use HEAD request to check if that url works.

I tried using a REST client name Postman (Chrome extension) to test http requests and the server always return 404 for HEAD. But Mandrill requires the response code 200 to work properly.

Does Services module support HEAD requests? If not, please help me to make it work. Thank you.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

rfay’s picture

Category: support » feature

Yes, I'm facing this also.

@trickyken, I'm working on mandrill too (but to receive emails). Is your code available anywhere?

rfay’s picture

Here's one way to provide a trivial HEAD. This just treats HEAD on the index as if it were GET. (this is for 6.x-3.x, but I imagine it's the same)

rfay’s picture

Status: Active » Needs review
FileSize
642 bytes

I haven't tested it, but this patch looks to me like what's required for D7

Status: Needs review » Needs work

The last submitted patch, services.restful_head_1993776_d7__03.patch, failed testing.

ygerasimov’s picture

Status: Needs work » Needs review
FileSize
954 bytes

Please test attached patch.

Status: Needs review » Needs work

The last submitted patch, services-HEAD-1993776.patch, failed testing.

ygerasimov’s picture

Status: Needs work » Needs review

#5: services-HEAD-1993776.patch queued for re-testing.

Status: Needs review » Needs work

The last submitted patch, services-HEAD-1993776.patch, failed testing.

ygerasimov’s picture

Status: Needs work » Fixed

Test bot does something wrong. I have committed HEAD method patch. Please test using dev version.

rfay’s picture

Version: 7.x-3.3 » 6.x-3.x-dev
Status: Fixed » Needs work

The reason the patch didn't apply was that the version was set to 7.x-3.3 instead of 7.x-3.x-dev.

Would you mind putting this into 6.x-3.x-dev as well?

Thanks!

rfay’s picture

Status: Needs work » Patch (to be ported)
ygerasimov’s picture

6.x branch is no more supported (there are huge debates in #2014573 about it). We need maintainer for 6.x branch

rfay’s picture

Yeah... I understand :-) Just had hopes, as my deployment is 6.x.

trickyken’s picture

Version: 6.x-3.x-dev » 7.x-3.3
trickyken’s picture

Status: Patch (to be ported) » Needs review

#5: services-HEAD-1993776.patch queued for re-testing.

Status: Needs review » Needs work

The last submitted patch, services-HEAD-1993776.patch, failed testing.

trickyken’s picture

Version: 7.x-3.3 » 7.x-3.x-dev
trickyken’s picture

Status: Needs work » Needs review

#5: services-HEAD-1993776.patch queued for re-testing.

ygerasimov’s picture

Status: Needs review » Patch (to be ported)

@trickyken patch #5 has been committed to 7.x branch. Please keep this issue as needs port status.

marcingy’s picture

Status: Patch (to be ported) » Closed (fixed)

This is fixed there is no d6.