How to add plain text in request body?

How to add plain text in request body?

  

How do i send plain text in the request body of a POST REST service?

Set HTTP Method to POST
Request format: Plain Text
I made an input parameter set to 'send in' : body


But I don't think the request body is being filled with the input parameter.


Can anyone help me out?

Hi DontPoke,

Are you consuming the web service or exposing it?
In this case, I'm not seeing anything wrong. The text you assign to the input parameter will be put in the body of the request.

I just exposed and consumed a REST as a test, and used the OnRequest of the service to check the request Text and the text I gave to the input parameter is there.

Why do you think the request body is not being assigned to the body?

Cheers,
Eduardo Jauch


Eduardo Jauch wrote:

Hi DontPoke,

Are you consuming the web service or exposing it?
In this case, I'm not seeing anything wrong. The text you assign to the input parameter will be put in the body of the request.

I just exposed and consumed a REST as a test, and used the OnRequest of the service to check the request Text and the text I gave to the input parameter is there.

Why do you think the request body is not being assigned to the body?

Cheers,
Eduardo Jauch


I am consuming the web service

I don't know how to check if the body is being filled or not.

If i open the webservice I leave the Body Request empty, does it fill the body automatically with the input parameter?


I added an image of the input parameter


PS If I take the parameters and put them in manually using the test function it works.


Also the text im trying to put into the body is:


command=returnBalances&nonce=1504084822

Solution

DontPoke wrote:

Eduardo Jauch wrote:

Hi DontPoke,

Are you consuming the web service or exposing it?
In this case, I'm not seeing anything wrong. The text you assign to the input parameter will be put in the body of the request.

I just exposed and consumed a REST as a test, and used the OnRequest of the service to check the request Text and the text I gave to the input parameter is there.

Why do you think the request body is not being assigned to the body?

Cheers,
Eduardo Jauch


I am consuming the web service

I don't know how to check if the body is being filled or not.

If i open the webservice I leave the Body Request empty, does it fill the body automatically with the input parameter?


I added an image of the input parameter


PS If I take the parameters and put them in manually using the test function it works.



Hi,

Yes, it will take the input parameter value and put in the body, as it is.

Cheers,
Eduardo Jauch

Solution

Eduardo Jauch wrote:

Hi,

Yes, it will take the input parameter value and put in the body, as it is.

Cheers,
Eduardo Jauch

I got it working, you are a genius!


DontPoke wrote:

Eduardo Jauch wrote:

Hi,

Yes, it will take the input parameter value and put in the body, as it is.

Cheers,
Eduardo Jauch

I got it working, you are a genius!


lol

Thanks, but I'm far from being a genius.
But I'm glad I was of help, even if you would have put it working without it ;)

Cheers,
Eduardo Jauch