Problem/Motivation
Not all APIs allow GET requests, some prefer the POST method. It could be useful to allow this module to give developers/site editors the opportunity to choose which method to retrieve the JSON to use.
Proposed resolution
Allow users to select different request method from views_json_source query handler plugin options.
User interface changes
A new 'Request method' select element is provided on 'Query settings' and a request body textarea to allow users pass form parameters to the request.
API changes
A new option for 'post' request method is provided, and 'get' is set as default.
Data model changes
None.
Comments
Comment #3
joao.ramos.costa commentedComment #5
astonvictor commentedComment #7
astonvictor commentedCreated and merged a new MR.
You can select the (post/get) method now.
for testing, I created a new
@RestResourceplugin with both post and get methods that return different data.Comment #8
astonvictor commentedComment #9
joao.ramos.costa commentedThanks a lot for the quick review and merging
Comment #10
joao.ramos.costa commentedHi @AstonVictor,
thanks again for maintaining the module.
I now see that the possibility of passing arguments within the body of the POST request in the commit has dropped at commit https://git.drupalcode.org/project/views_json_source/-/merge_requests/6/..., I was already using this in a project so unfortunately I still cannot update to release 2. To make things more difficult, the getRequestResponse method is private and prevents an class override to change the method and thus the request parameters.
Should I open a new issue?
Kind regards,
João.
Comment #13
astonvictor commentedHi @joao.ramos.costa,
merged changes to the 2.0.x branch.
I'll resolve a few tasks more and create a new release. for now, you can use the dev version of the module that contains fixes.
thanks
Comment #14
joao.ramos.costa commentedHi @AstonVictor,
Thanks a lot!