Crocoblock / suggestions

The suggestions for CrocoBlock project
191 stars 78 forks source link

JetEngine Forms Rest API request body bug #7579

Open DrifterOne opened 1 week ago

DrifterOne commented 1 week ago

Describe the bug In JE Forms, when choosing "Rest API request" as type, the description for the custom body explainst the request body will be in JSON format. But it is not.

To Reproduce Steps to reproduce the behavior:

  1. Create a new form in JE forms.

  2. add a hidden field, for current user ID, named user_id

  3. edit the submit button

  4. choose "Rest API request" as type

  5. add your API URL

  6. define your custom body. In my case: { "id": %user_id%, "login": "johndoe", "email": "john.doe@somewhere.com", "test": "test1233" }

  7. Save and publish the form and add it to a WP page

  8. Open that page and press the button to execute the request.

  9. Check the request on API side. In my case the body will not contain a valid JSON format, but look like this: id=1&login=johndoe&email=john.doe%40somewhere.com&test=test1233

Expected behavior A valid, standard formatted JSON content would be expected.

Screenshots iScreen Shoter - Brave Browser - 240621184230

Desktop (please complete the following information):

Additional context Also a further suggestion for JetEngine Query Builder: When adding keys and values to a query, these are usually added as a parameter to the API request, which is not always the best or desired approach, regarding security. Please add an option to send the keys and values as JSON body, so the whole request will be sent consistant and secured.