2
1
0

Hi guys,

The JSON POST tool has request headers which is very useful for many external apis.
However, many apis also require request headers for GET requests (and don't allow POST requests).

Is there any way of setting the request headers in the existing JSON (GET) Tool or would it be possible to update the plugin to make this possible?

Cheers,

Eric 

    CommentAdd your comment...

    2 answers

    1.  
      2
      1
      0

      Beta 2 of Joget 6 has this feature in the standard JSON Tool. (smile)

      I was able to get rid of my Beanshell tools - which is great.

        CommentAdd your comment...
      1.  
        1
        0
        -1

        Hi, found the source code for the JSON Tool at https://github.com/jogetworkflow/jw-community/blob/5d71cfabb90767e9ee9db461a80bb221859d2fea/wflow-core/src/main/java/org/joget/apps/app/lib/JsonTool.java. Don't see a setting for request headers, so until that's added in future versions you might need to either customize it or duplicate it to make an enhanced plugin.

         

        1. Eric

          Hey Anders, It looks like the get and post plugins are quite similar so with the POST Tool Source Code it could be almost copy and paste - therefore I thought it might be good for the development team to make the improvement and f.e roll it out with Joget 5.0.15 and 6beta2.

        2. Eric

          Anders Based on the code on github, the Plugin needs to integrate this line of code (based on the Authorization Header example): get.addHeader("Authorization", "Bearer " + token); I reconstructed it for a specific header get request in the beanshell tool which works for my use case but it would be really great to have it in the standard plugin.

        CommentAdd your comment...