Callback before http request
Note: All http requests from the plugin will trigger this callback.
Rule Target (context it) | Additional Context |
---|---|
None | request |
Logging all requests from the plugin
http.call.before=groovy:logger.info("call:"+request.url())
Automatically adding a specified token
http.call.before=groovy:```
request.header("token","xxxxxxxxxxxxx")
```
Automatically adding a token retrieved from localStorage
http.call.before=groovy:```
//Retrieve token from localStorage
request.header("token",localStorage.get("token"))
```