In drupal_http_request(), the request body must be provided as a URL-encoded query string. It would be more convenient to be able to provide this as an array and have the function call http_build_query() on it automatically. Patch coming.

Comments

Liam Morland created an issue. See original summary.

liam morland’s picture

Assigned: liam morland » Unassigned
Status: Active » Needs review
StatusFileSize
new1.34 KB
fabianx’s picture

Issue tags: +Needs tests

This will need a test, I think.

liam morland’s picture

With tests.

Status: Needs review » Needs work

The last submitted patch, 4: drupal-drupal_http_request_data_array-2814031-4-D7.patch, failed testing.

The last submitted patch, 4: drupal-drupal_http_request_data_array-2814031-4-D7.patch, failed testing.

liam morland’s picture

Status: Needs work » Needs review
StatusFileSize
new2.96 KB

Reroll.

fabianx’s picture

Issue tags: +Drupal 7.60 target

I think we can even get this in, because Drupal 8 has guzzle, which for sure has a different syntax so we should be free to tweak things here.

Needs someone else to RTBC it, but it looks good to me on a first glance.

pol’s picture

Status: Needs review » Reviewed & tested by the community

Nice idea and patch including tests.

Fine for me :)

pol’s picture

Issue tags: +Pending Drupal 7 commit
joseph.olstad’s picture

Issue tags: -Drupal 7.60 target +Drupal 7.61 target

Bumping to 7.61, this didn't make it into 7.60

joseph.olstad’s picture

joseph.olstad’s picture

  • Pol committed 23ae731 on 7.x
    Issue #2814031 by Liam Morland: In drupal_http_request(), allow passing...
pol’s picture

Status: Reviewed & tested by the community » Fixed
Issue tags: -Drupal 7.64 target, -Pending Drupal 7 commit +Drupal 7.67 target

Patch has been committed, thanks !

liam morland’s picture

Thanks!

mustanggb’s picture

Oooh very nice.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

liam morland’s picture

I just realized this probably should have been drupal_http_build_query() instead of http_build_query().

pol’s picture

Let's open a new issue and fix it :)

liam morland’s picture