You are not logged in.
Hello,
I am testing the framework for the purpose of creating a proxy server to a number of internal REST services.
I am overriding TSqlHttpServer.Request method with the following code
vURL := Ctxt.URL;
GetServiceConnectionPoint(vURL, vAddress, vPort);
vClient := THttpClientSocket.Open(vAddress, vPort);
try
result := vClient.Request(Ctxt.URL, Ctxt.Method, 5000, Ctxt.InHeaders, Ctxt.InContent, Ctxt.InContentType, TRUE);
Ctxt.OutContent := vClient.Content;
Ctxt.OutContentType := vClient.ContentType;
Ctxt.OutCustomHeaders := '';
for vIdx := Low(vClient.Headers) to High(vClient.Headers) do
Ctxt.OutCustomHeaders := Ctxt.OutCustomHeaders + vClient.Headers[vIdx];
finally
vClient.free;
end;
This works fine for a number of scenarios like .Get and .Delete, but it does not return anything in .Content for some POST requests, while the end point does return the content.
Any advice, other than read the docs and samples (i did that already).
Thanx alot.
Offline
Your headers are missing a #13#10 between the lines.
Is it what you mean? This does not work properly either...
Ctxt.OutCustomHeaders := '';
for vIdx := Low(vClient.Headers) to High(vClient.Headers) do
Ctxt.OutCustomHeaders := Ctxt.OutCustomHeaders + #13#10 + vClient.Headers[vIdx];
Offline