Hello, I'm connecting to a server. I have to send a post request using TFPHTTPClient, with content-type as application/x-www-form-urlencoded.
So I wrote:
PeticionHttp.AddHeader('Content-Type', 'application/x-www-form-urlencoded;v=2.0');
PeticionHttp.AddHeader('Accept', 'application/hal+json;v=2.0');
Respuesta := TStringList.Create();
BodyText := 'resources=1&1=/rw/iosystem/signals/ethernet/board1/do0&1-P=0';
PeticionHttp.RequestBody := TRawByteStringStream.Create;
PeticionHttp.RequestBody.WriteAnsiString(BodyText);
PeticionHttp.Post('https://localhost:80/subscription', Respuesta);
The problem is that the server answers: 400 Bad Request
If I make the request using Postman (a small program to test requests) I don´t get any error as you can see in the picture.
I think that the problem is that I'm make same mistake in my code. But I don't know what
Thanks
/BlueIcaro