Watch, Follow, &
Connect with Us
Public Report
Report From: Delphi-BCB/Database/DataSnap/Client    [ Add a report in this area ]  
Report #:  105400   Status: Need Feedback
Header Accept
Project:  Delphi Build #:  16.0.4429.46931
Version:    16.4 Submitted By:   Sophie Rodari
Report Type:  Minor failure / Design problem Date Reported:  5/6/2012 7:55:30 AM
Severity:    Serious / Highly visible problem Last Updated: 5/6/2012 7:24:00 PM
Platform:    All platforms Internal Tracking #:  
Resolution: Need More Info (Resolution Comments) Resolved in Build: : None
Duplicate of:  None
Voting and Rating
Overall Rating: No Ratings Yet
0.00 out of 5
Total Votes: None
Description
When i want create a datasnap client for apache server, the header "Accept: application/JSON" is rejected with an apache error 406: not acceptable variant

If i use "Accept : application/JSON, */*" it's OK. Because application/JSON is not ready for apache

In Datasnap.DSClientRest, line 1142,
procedure ExecuteRequest(AHTTP: TDSHTTP; const AURL, LRequestType, LUserName, LPassword: string; LParameters: TDBXParameterList;
  const ARequestFilter, AAccept: string; var ASessionID: string;
  LSessionExpired: TProc; LSetSessionID: TProc<string>); overload;

AAccept is a parameter called by line 1093,
procedure ExecuteCommand(ACommand: TDSRestCommand; const ARequestFilter, AAccept: string); overload;


But this procedure is called with empty AAccept value
791: procedure ExecuteCommand(ACommand: TDSRestCommand; const ARequestFilter: string; const AAccept: string = ''); forward;

794:procedure TDSRestCommand.Execute(const ARequestFilter: string);
begin
  BeforeExecute;
  try
    if Connection.LoginProperties.LoginPrompt then
      if not Connection.Login then
        System.SysUtils.Abort;
=>>>>    ExecuteCommand(Self, ARequestFilter);
  finally
    AfterExecute;
  end;
end;


Call Execute method with Accept parameter is not possible.

And call DShttp.Resquest.Accept is not used in Datasnap algorithm
Steps to Reproduce:
Use your own HowTo make a Datasnap client with standard services "EchoString" for example.
Workarounds
None
Attachment
None
Comments

Tomohiro Takahashi at 5/6/2012 7:23:58 PM -
> When i want create a datasnap client for apache server ...
Could you please attach sample projects(server/client) to reproduce/confirm your issue?

and, what version of Apache do you use?

Server Response from: ETNACODE01