Требуется отправить запрос вида:
POST /connect/token HTTP/1.1
Host: bba.nsal.cloud:5000
Content-Type: application/x-www-form-urlencoded
Cache-Control: no-cache
client_id=E45D3491-79EE-4EEA-92B2-22CEBE4BB8B5&client_secret=1234567&grant_type=client_credentials
Но при отправке получаю, что body содержит спец. символы: '%3D' вместо "=", '%26' вместо "&"
POST /connect/token HTTP/1.1
Cache-Control: no-cache
Connection: Keep-Alive
Content-Type: application/x-www-form-urlencoded
Content-Length: 109
Host: bba.nsal.cloud:5000
client_id%3D03215B1D-7B0F-4E5C-A81A-81D8A1790915%26client_secret%3D95CMsyy6%26grant_type%3Dclient_credentials
Каким образом отправить запрос без преобразования спец. символов?
Отправляю вот так:
RESTCli := TRESTClient.Create(rURL_Auth);
with RESTCli do begin
ContentType := 'application/x-www-form-urlencoded';
AutoCreateParams := True;
Params.Clear;
Params.AddHeader('Cache-Control',rCacheControl);
Params.AddHeader('Connection',rConnection);
end;
RESTReq := TRESTRequest.Create(RESTCli);
RESTResp := TRESTResponse.Create(RESTReq);
with RESTReq do begin
Client := RESTCli;
AcceptCharset := 'UTF-8';
Response := RESTResp;
Resource := 'connect/token';
Method := rmPOST;
Params.Clear;
AddBody(pFile);
Execute;
end;
Result := RESTResp.Content;