You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by BlakeUMN <bl...@software.umn.edu> on 2008/01/03 02:23:51 UTC

Specifying Content-Type for Java Request

I have a Java Request with resultData = "Foo ${jmeterVariable} Bar" and a
child "Save Responses to a file" having a Filename prefix of Baz.bop. The
file is written to disk with the filename Baz.bop1.unknown and I would like
it to be written as Baz.bop. The makeFileName method of
org.apache.jmeter.reporters tells me the n.unknown being appended is due to
a missing Content-Type in the response.
How do I set the Content-Type of the Java Request? Is there an easier way to
do this?
Thanks,
Blake
-- 
View this message in context: http://www.nabble.com/Specifying-Content-Type-for-Java-Request-tp14589913p14589913.html
Sent from the JMeter - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org


Re: Specifying Content-Type for Java Request

Posted by sebb <se...@gmail.com>.
Save Response to file was not designed for this purpose, but if you
want to use it, I suggest you use a unique file prefix for each.

If you are able to code in Java, you could use one of the BeanShell
elements to create the files.

On 03/01/2008, BlakeUMN <bl...@software.umn.edu> wrote:
>
> Thanks for the reply.
>
> I am generating multiple HTTP POST bodies (as files) which contain static
> data as well as data from Jmeter variables.
>
> A group of Java Request -> Save Responses pairs take care of generating the
> files, and the Send a File.. feature of an HTTP Request lets me specify the
> file containing the POST body. I don't want to point to Baz.bop1.unknown in
> the HTTP Request, because if I add a Save Responses to File Post Processor
> above the point where I generate Baz.bop1.unknown, the file will be
> generated as Baz.bop2.unknown, and the reference to Baz.bop1.unknown will be
> destroyed.
>
> The only way I see this working is if I have full control over the filename,
> or the HTTP Request can point to a filename like /foo/Baz.bop* and fill in
> the details itself. I'm open to ideas though.
>
> Thanks,
> Blake
>
>
> sebb-2-2 wrote:
> >
> > On 03/01/2008, BlakeUMN <bl...@software.umn.edu> wrote:
> >>
> >> I have a Java Request with resultData = "Foo ${jmeterVariable} Bar" and a
> >> child "Save Responses to a file" having a Filename prefix of Baz.bop. The
> >> file is written to disk with the filename Baz.bop1.unknown and I would
> >> like
> >> it to be written as Baz.bop. The makeFileName method of
> >> org.apache.jmeter.reporters tells me the n.unknown being appended is due
> >> to
> >> a missing Content-Type in the response.
> >
> > The .unknown suffix is due to the missing Content-Type. The n suffix
> > is the file number, which cannot be omitted.
> >
> >> How do I set the Content-Type of the Java Request?
> >
> > Not possible currently.
> >
> >> Is there an easier way to do this?
> >
> > What are you really trying to do?
> >
> >> Thanks,
> >> Blake
> >> --
> >> View this message in context:
> >> http://www.nabble.com/Specifying-Content-Type-for-Java-Request-tp14589913p14589913.html
> >> Sent from the JMeter - User mailing list archive at Nabble.com.
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> >> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
> >>
> >>
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
> >
> >
> >
>
> --
> View this message in context: http://www.nabble.com/Specifying-Content-Type-for-Java-Request-tp14589913p14601189.html
> Sent from the JMeter - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org


Re: Specifying Content-Type for Java Request

Posted by BlakeUMN <bl...@software.umn.edu>.
Thanks for the reply.

I am generating multiple HTTP POST bodies (as files) which contain static
data as well as data from Jmeter variables.

A group of Java Request -> Save Responses pairs take care of generating the
files, and the Send a File.. feature of an HTTP Request lets me specify the
file containing the POST body. I don't want to point to Baz.bop1.unknown in
the HTTP Request, because if I add a Save Responses to File Post Processor
above the point where I generate Baz.bop1.unknown, the file will be
generated as Baz.bop2.unknown, and the reference to Baz.bop1.unknown will be
destroyed.

The only way I see this working is if I have full control over the filename,
or the HTTP Request can point to a filename like /foo/Baz.bop* and fill in
the details itself. I'm open to ideas though.

Thanks,
Blake


sebb-2-2 wrote:
> 
> On 03/01/2008, BlakeUMN <bl...@software.umn.edu> wrote:
>>
>> I have a Java Request with resultData = "Foo ${jmeterVariable} Bar" and a
>> child "Save Responses to a file" having a Filename prefix of Baz.bop. The
>> file is written to disk with the filename Baz.bop1.unknown and I would
>> like
>> it to be written as Baz.bop. The makeFileName method of
>> org.apache.jmeter.reporters tells me the n.unknown being appended is due
>> to
>> a missing Content-Type in the response.
> 
> The .unknown suffix is due to the missing Content-Type. The n suffix
> is the file number, which cannot be omitted.
> 
>> How do I set the Content-Type of the Java Request?
> 
> Not possible currently.
> 
>> Is there an easier way to do this?
> 
> What are you really trying to do?
> 
>> Thanks,
>> Blake
>> --
>> View this message in context:
>> http://www.nabble.com/Specifying-Content-Type-for-Java-Request-tp14589913p14589913.html
>> Sent from the JMeter - User mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>>
>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Specifying-Content-Type-for-Java-Request-tp14589913p14601189.html
Sent from the JMeter - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org


Re: Specifying Content-Type for Java Request

Posted by sebb <se...@gmail.com>.
On 03/01/2008, BlakeUMN <bl...@software.umn.edu> wrote:
>
> I have a Java Request with resultData = "Foo ${jmeterVariable} Bar" and a
> child "Save Responses to a file" having a Filename prefix of Baz.bop. The
> file is written to disk with the filename Baz.bop1.unknown and I would like
> it to be written as Baz.bop. The makeFileName method of
> org.apache.jmeter.reporters tells me the n.unknown being appended is due to
> a missing Content-Type in the response.

The .unknown suffix is due to the missing Content-Type. The n suffix
is the file number, which cannot be omitted.

> How do I set the Content-Type of the Java Request?

Not possible currently.

> Is there an easier way to do this?

What are you really trying to do?

> Thanks,
> Blake
> --
> View this message in context: http://www.nabble.com/Specifying-Content-Type-for-Java-Request-tp14589913p14589913.html
> Sent from the JMeter - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org