I'm unaware of details of protobuf particularly with HTTP, but if you were
to make an HTTP request using a REST/API client/tool (or custom scripting)
or a browser based REST client, what would it actually look like for what
you send, and/or rather what does the raw data look like when you sniff it
say with an HTTP proxy like fiddler/charles.

I'm just wondering if jmeter is the only tool with the issue or other REST
clients have it too or not.

How are you POSTing the data exactly? Pasting the value in the GUI field in
the sampler? Or via a file upload/POST? If the former, I suggest you try
the latter of POSTing/uploading an empty protobuf encoded file with jmeter
and see if that works for you. And be sure the file is generated/encoded
using protobuf tooling (or scripts), not some text editor. Because protobuf
is a binary format as I recall, denoting it as b'' might just be treated as
plain text by jmeter regardless of the Content-Type (unless jmeter was
smart to key off that header value). A library that deals with protobuf or
some languages like python might understand b'' to be empty binary data,
but other tools may not and think that just a literal string value. Using
true protobuf encoded file (or dumping that value out) will ensure you get
the right encoding.

If the GUI based HTTP sampler isn't ideal or working, you could try the
scripting based samplers using Java, Groovy, Javascript together with
protobuf and HTTP libraries for those languages to do what you need.

On Wed, Jun 20, 2018 at 5:34 PM, Britt Cagnina <tyr...@gmail.com> wrote:

> I have a Sampler HTTP Request setup with the body as:
>
> b''
>
> This is a simple empty protobuf object, but JMeter is actually sending some
> wrapped version of this:
>
> b"b''"
>
> I have used Content-Type to be both application/protobuf and
> application/octet-stream.
>
> Is there a way to get JMeter to post EXACTLY what I give it?
>
>
> I have an open stack overflow issue for better formatting:
> https://stackoverflow.com/questions/50957492/jmeter-not-
> posting-binary-data-correctly
>
> Thanks,
> Britt
>

Reply via email to