Request Headers in JSON Tool (GET)

Confluence User - 30 Apr, 2017

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 

json;plugins;api

4


02 May, 2017
confluenceUser
confluenceUser

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.

 

02 May, 2017
confluenceUser
confluenceUser

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.

11 May, 2017
confluenceUser
confluenceUser

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.

19 May, 2017
confluenceUser
1
confluenceUser

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.

RELATED QUESTIONS

Your answer


To answer a question you'll need an account.

Print