When sending requests to the server using the TXDataWebClient component using the RawInvoke method, I'm able to keep the request url pretty clean like in the image below, which is what I want.
When using the OnFetchNextPage event of the TWebContinuousScroll component, the url parameters are shown in the request url. How can I prevent this from happening?
The parameters need to request a next page of data from the TWebContinousScroll component contain the information on what page + page length is needed for this component. This is how this continuous list control works. Do you experience an issue with this?
I know it works that way, I'm just asking if there is another way to at least hide the SQL part of the request. Showing everything like this might result in a security breach, and that's a pretty big issue don't you think?
Currently this is not possible to do as TWebContinuousScroll works with HTTP GET requests only. We'll add an option to change between GET and POST requests.
You need to set TWebContinuousScroll.RequestMode to rmPOST and then you can specify the body of the request via the TWebContinuousScroll.PostData property.
If you need to send different data every time, then you can use the OnFetchNextPage event to do so:
procedure TForm1.WebContinuousScroll1FetchNextPage(Sender: TObject; APageSize,
APageNumber: Integer; var AURL: string);
begin
AURL := 'URL where the POST request goes';
WebContinuousScroll1.PostData := 'my data';
end;
This will enable you to send something with your request without putting that information into the request URL.
Hi, Thanks for explanation of post usage but I did not get it properly. Let's suppose I've a client and xdataserver. On the client side I have continuousscroll. I want to send my data from client to the server via post method. As I understand from your explanation, in the AURL property I must set server url and in the PostData property I must set the payload which I will send to the server. (please correct me if I'm wrong ). What kind of arragements shall I do on the xdataserver side to get those posted payload and send the response to the client via post method as well ? Thanks in advance
I've a service called IMyService in my XDataServer. XDataServer runs on http://a.b.c.d:80 adress. There is a function called btQuery(value:String) in that service and it returns a TStream value. on the client side when I called that btQuery function with a string parameter it returns TStream value. It's okay if I use get method because I called that function with parameter on the url for example http://a.b.c.d:80/c/api/MyService/btQuery?value='myscretdata' . It works good. I want to use continuous scroll to send string parameters to that btQuery function via POST method. So, I do not want to called btQuery function from the url. How can I do that ?
Just change your XData service to accept POST (instead of GET) and to accept the parameter via body (instead of query) - even though when you use POST, the parameter must be sent via body by default.