2

I'm trying to send one HTTP request using JMeter, the problem is I don't know how to send the parameters.

I have my form in frontend in this way:

<form id="SampleForm" method="POST" action="MyHandler.ashx" enctype="multipart/form-data">
 ... 
 ....
 .....
</form>

I send this form to backend using: $("#SampleForm").submit()

And backend is built as following:

public class MyHandler: IHttpHandler, IRequiresSessionState {
    public void ProcessRequest(HttpContext context) {
        ...
        ...
        ...
        var PartOfRequest = context.Request.Form["myFormElement"];
        ...
        ...
        ...
    }
}

The problem is in this part: context.Request.Form. I can send the HTTP Request to the handler, but it fails because it does not find the content of context.

Backend is waiting for one HTTP CONTEXT but I don“t know how I can sent a context from JMeter or if it is possible.

Gabbo CR
  • 31
  • 3

2 Answers2

1

The easiest way to build the correct HTTP Request in JMeter is just recording it. There are several approaches like:


If you need just a single request and consider recording the "overkill" - try the following changes in HTTP Request sampler

  1. Change method to POST
  2. Tick Use multipart/form-data for POST

JMeter multipart post

Graham
  • 7,431
  • 18
  • 59
  • 84
Dmitri T
  • 159,985
  • 5
  • 83
  • 133
0

Please share screenshot of your JMeter script. Without that I can only suggest recording the request with Fiddler to see how the parameters are sent.

uru917
  • 91
  • 13