Great module. But I have to do a fair bit of work to get the request into a format that's generally accepted by most web services (i.e. POX, JSON).

It shouldn't be that hard to:

A) Provide an output format option to switch between JSON and POX (XML) - or just JSON really.

or/and

B) Leave the output mapping up to the user and let us build the request in plain text and substitute the relevant tokens into the request data.

Comments

strainyy’s picture

Issue summary: View changes
strainyy’s picture

StatusFileSize
new959 bytes

Attached is a patch that essentially removes the formatting restriction imposed on the user and lets them manage the request body as they see fit.

strainyy’s picture

Component: Miscellaneous » Code
Status: Active » Needs review
deciphered’s picture

Version: 7.x-1.0-beta1 » 7.x-1.x-dev
StatusFileSize
new2.23 KB

I worked on this before noticing this issue, but have implemented a solution that is compatible with your needs anyway. Essentially it just adds a 'data_encoding' selection, which can be Default (drupal_http_build_query) / JSON (json_encode) / None/Raw (as per your patch).

Not committing straight away as I'd like it tested, especially given that there is no upgrade path (nor is there in yours).

twistor’s picture

Status: Needs review » Needs work

This should use drupal_json_encode().

jsibley’s picture

This worked well for me, so far (just started trying it).

I could not figure out how to send a POST with json body that would work, as the syntax expected by the original module is poorly documented.

However, I could copy and paste json that worked in Postman, using the raw option provided by this patch, and it worked.

Thank you!

sano’s picture

I can confirm @jsibley's observation.