Param null when do PUT HTTP call

  

I do some test with a REST API.
When I do a POST call :
Param := TMultipartFormData.Create;

Param.AddField(‘param1’, ‘value1’);
Param.AddField(‘param2’, ‘value2’);

Response := Client.Post(‘http://localhost/project/public/login’, Param);

I can use param1 and param2 in my backend.
When I do same with PUT method, I can’t use my param, param1 and param2 are null
Param := TMultipartFormData.Create;

Param.AddField(‘param1’, ‘value1’);
Param.AddField(‘param2’, ‘value2’);

// Headers contain my JWT

Response := Client.Put(‘http://localhost/project/public/api/profile’, Param, nil, Headers);

To use my param in PUT call I need to add it in my URL but I didn’t want use it like that.
Client.Put(
‘http://localhost/project/public/api/profile?param1=value1’,
nil, nil, Headers); // work but bad solution

I use Firemonkey 10.4.2 .
EDIT: My PUT call work in Postam when I’m with body x-www-form-urlencoded. When I use form-data, I get null param.
How can I give param in x-www-form-urlencoded ?

Comments are closed.