Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot insert any body in the HTTP request

Tags:

When I try to enter anything in the body of HTTP Request, when I click anything else, I get:

You cannot switch because data cannot be converted to Target tab data, empty data to switch

What is that ? I am running Windows 10.

like image 253
Jerzy Gruszka Avatar asked Jul 27 '16 09:07

Jerzy Gruszka


People also ask

Can http request have body?

GET requests don't have a request body, so all parameters must appear in the URL or in a header. While the HTTP standard doesn't define a limit for how long URLs or headers can be, mostHTTP clients and servers have a practical limit somewhere between 2 kB and 8 kB.

Can you send a body in a GET request?

So, yes, you can send a body with GET, and no, it is never useful to do so. This is part of the layered design of HTTP/1.1 that will become clear again once the spec is partitioned (work in progress). Yes, you can send a request body with GET but it should not have any meaning.

What is a request body?

A request body is data sent by the client to your API. A response body is the data your API sends to the client. Your API almost always has to send a response body. But clients don't necessarily need to send request bodies all the time.

Does post require body?

A POST request requires a body in which you define the data of the entity to be created.


1 Answers

Stumbled across this very issue recently, which confused me. JMeter’s documentation on Parameter Handling says this is normal. To switch back to another tab you have to clear the data.

Note that once you leave the Tree node, you cannot switch back to the parameter tab unless you clear the Body Data tab from its data.

It is possible to switch from the Parameters tab to the Body Data tab and JMeter will automatically convert data for you, but not vice-versa, since the Body Data tab allows you to enter more complex data, such as JSON, XML, & SOAP for your HTTP requests. This indicator doesn’t prevent you from using the request for testing, it only blocks you from switching over to the other tabs.

like image 123
mike v Avatar answered Sep 21 '22 12:09

mike v