It would be useful to have the ability to plug a Sampler Customizer that depending on content type. One example I need currently is the following: - For GWT samplers for example it would be useful to be able to directly set element.setProperty(HTTPSamplerBase.POST_BODY_RAW, useRaw, HTTPSamplerBase.POST_BODY_RAW_DEFAULT); Another requirement I have is to be able to customize created sampler, A direct use I see is for example a SilverLight or Flex protocol, doing this will enable plugins to implement a factory and use current implementations of Proxy, ProxyControl and HttpRequestHdr. This could be done by delaying sampler creation until rawPostBody and contentType are available in HttpRequestHdr, once these are available , a factory could be called with content type , this would enable plugging other Samplers than just HttpSampler.
Created attachment 28385 [details] Patch proposal
Created attachment 28398 [details] Patch with Test updated Hello, I made some thorough testing of the code. I also implemented an Binary (POST body) based protocol successfully by implementing a SamplerCreator subclass. I think this feature will be very useful to allow recording protocols as AMF , Silverlight by plugins. Can I commit it or you want to review it first ? Thanks Regards Philippe
Date: Fri Mar 2 23:37:26 2012 New Revision: 1296512 URL: http://svn.apache.org/viewvc?rev=1296512&view=rev Log: Bug 52674 - Proxy : Add a Sampler Creator to allow plugging HTTP based samplers using potentially non textual POST Body (AMF, Silverlight...) and customizing them for others Added: jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/proxy/AbstractSamplerCreator.java (with props) jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/proxy/DefaultSamplerCreator.java (with props) jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/proxy/SamplerCreator.java (with props) jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/proxy/SamplerCreatorFactory.java (with props) Modified: jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/proxy/HttpRequestHdr.java jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/proxy/Proxy.java jmeter/trunk/xdocs/changes.xml
Date: Fri Mar 2 23:39:17 2012 New Revision: 1296513 URL: http://svn.apache.org/viewvc?rev=1296513&view=rev Log: Bug 52674 - Proxy : Add a Sampler Creator to allow plugging HTTP based samplers using potentially non textual POST Body (AMF, Silverlight...) and customizing them for others Modified: jmeter/trunk/test/src/org/apache/jmeter/protocol/http/proxy/TestHttpRequestHdr.java
*** Bug 49039 has been marked as a duplicate of this bug. ***
This issue has been migrated to GitHub: https://github.com/apache/jmeter/issues/2735