#1 2025-11-02 10:06:42

anouri
Member
Registered: 2024-02-11
Posts: 133

Inbody is not valid json!

Hi

serviceRunningContext^.Request.InBody is not valid json.

this is service method:

function TAuthenticationService.Login(const UserName, Password: RawUTF8): RawJson;
begin
  var a := serviceRunningContext^.Request;

  var b := TPassakRest(Server).fRestServerAuthentication;
  TRestServerAuthenticationJWT(b).Auth(a);
end;

body json is:
{
  "UserName": "Admin",
  "Password": "synopse"
}

serviceRunningContext^.Request.InBody is

{"UserName: "Admin  "Password: "synopse

Last edited by anouri (2025-11-02 10:07:02)

Offline

#2 2025-11-02 12:09:42

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 15,261
Website

Re: Inbody is not valid json!

This is as expected.
The JSON is parsed in place.

You should not use InBody here but only use the interface method parameters.

Offline

#3 2025-11-04 09:30:32

anouri
Member
Registered: 2024-02-11
Posts: 133

Re: Inbody is not valid json!

Solved
Thank you.

Offline

Board footer

Powered by FluxBB