Errm .. it looks like HTTPClient does not actually give access to the full response, which is probably why it was coded as it was.
Still need to fix it somehow, otherwise I suspect assertions against HTTPSampler2 will not work as expected when the body contains contain a blank line. S. On Apr 9, 2005 2:46 PM, sebb <[EMAIL PROTECTED]> wrote: > Just noticed that HTTPSampler sets responseData to the full response > read from the connection, whereas HTTPSampler2 sets it to the response > Body only. > > Seems to me that's a bug in HTTPSampler2. > > It got me thinking that perhaps the various SampleResult classes could > be enhanced to make the distinction clearer, and to make it easy to > get at the various parts of the full response. > > There are currently bits of code dotted around that search > responseData for the blank line in order to get just the response > body. Seems to me this code should be moved to the SampleResult > classes. > > How about: > > SampleResult > - responseData should always have the full response (i.e fix HTTPSampler2) > - add responseBody() method which returns responseData > - add responseHeaders() which returns the empty byte[] - or perhaps > throws an Exception? > > HTTPSampleResult > - override the responseBody() and responseHeaders() methods > - to avoid always storing the response twice, the methods could create > the sections on demand. But might as well store the position of the > blank line once found. > > I'm not familiar with the various other protocols (SOAP) etc so I > don't know if this would fit well with these. > > Any other suggestions? > > I will fix HTTPSampler2 anyway. > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
