Forum Discussion
SmartBear_Suppo
14 years agoSmartBear Alumni (Retired)
Hi,
hmm.. I think you will need to make the method static to be able to call it without first instantiating its containing class.
But that won't help you in 2, which isn't possible at this level of processing, you will have to create a custom RequestFilter.filterRequest handler instead from which you can get this information and update the header accordingly;
1) Open the project window and go to the Events tab
2) Add a handler for the RequestFilter.filterRequest event, and set its content to something in the line of:
// get method so we can get the complete URI
def method = context.getProperty( "httpMethod" )
// log the complete URI
log.info( method.URI.toString() )
// set an HTTP header
method.setRequestHeader( "test", "some value" )
Does that help?
regards,
/Ole
eviware.com
hmm.. I think you will need to make the method static to be able to call it without first instantiating its containing class.
But that won't help you in 2, which isn't possible at this level of processing, you will have to create a custom RequestFilter.filterRequest handler instead from which you can get this information and update the header accordingly;
1) Open the project window and go to the Events tab
2) Add a handler for the RequestFilter.filterRequest event, and set its content to something in the line of:
// get method so we can get the complete URI
def method = context.getProperty( "httpMethod" )
// log the complete URI
log.info( method.URI.toString() )
// set an HTTP header
method.setRequestHeader( "test", "some value" )
Does that help?
regards,
/Ole
eviware.com
Related Content
- 2 years ago
- 2 months ago
- 5 years ago
Recent Discussions
- 19 days ago