Problem
I have an operation with one optional parameter without default value. It is real use case: see 'cursor' parameter in "List Accounts" request definition at http://docs.recurly.com/api/accounts.
This makes request URI look like
https://:subdomain.recurly.com/v2/accounts?state=active&per_page=50&cursor=.
It breaks the entire request - so the Recurly service returns response 200 with no content inside.
Solution
We should check remaining parameters whether they are not empty - and only then include them into request URI.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | wsclient-2044587-avoid_empty_remaining_parameters_inside_request_uri-1.patch | 902 bytes | PatchRanger |
Comments
Comment #1
PatchRanger commentedDone, please review.
Comment #2
tito.brasolin commentedHello PatchRanger. A few months ago I had exactly your same problem, so I posted this feature request (with patch): https://drupal.org/node/1934274
Your patch looks fine (imho), but what if an empty parameter does have some meaning for the server? #1934274 can solve your problem in a more generalized and flexible way, just copy and paste the example (wsclient_rest.api.php) into your custom module or in https://drupal.org/project/myhook
Comment #3
PatchRanger commentedThanks a lot, I agree that your solution is more flexible.
I did look for related issues - but failed to find yours.
Closing this issue as duplicate of #1934274: Add support for $request_alter.