Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 4 of 4 total
Thread Server Requests and 2.05.
Wed, Nov 16 2016 12:33 AMPermanent Link

Steve Gill

Avatar

Hi Tim,

Were there any breaking changes in 2.05 in regards to server requests?  Have there been changes to the way requests are handled?

I recompiled a project in 2.05 that worked in a previous version of EWB and now the code below is not working.  I have checked the data being sent and it is correct (it is sent to a PHP script that hasn't changed).  

--AaB03x
Content-Disposition: form=data; name="coupon_code"
U123A47B
--AaB03x

The problem is, the assigned OnComplete event never seems to fire.

procedure TfrmMain.ValidateCouponCode(ACouponCode: string);
var
  ServerRequest: TServerRequest;
  MyRequestData: TCSRequestData;
begin                                              
  ServerRequest := RequestQueue.GetNewRequest;

  ServerRequest.ResponseContent.LineSeparator := #13 + #10;
  ServerRequest.OnComplete := ValidateCouponCodeRequestComplete;

  ServerRequest.URL := WebURL + 'validatecouponcode';

  MyRequestData := TCSRequestData.Create;

  try
     ServerRequest.RequestHeaders.Values['Content-Type'] := 'multipart/form-data; boundary=AaB03x';
     MyRequestData.AddData('coupon_code', ACouponCode);                                                 

     ServerRequest.RequestContent.Text := MyRequestData.GetRequestData;
     ServerRequest.Method := rmPost;     
     RequestQueue.AddRequest(ServerRequest);

     Showmessage(ServerRequest.RequestContent.Text);
  finally
     MyRequestData.Free;
  end;
end;

procedure TfrmMain.ValidateCouponCodeRequestComplete(Request: TServerRequest);
begin
  Showmessage(Request.ResponseContent.Text);      
end;


= Steve
Thu, Nov 17 2016 4:04 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Steve,

<< Were there any breaking changes in 2.05 in regards to server requests?  Have there been changes to the way requests are handled? >>

No.

<< I recompiled a project in 2.05 that worked in a previous version of EWB and now the code below is not working. >>

Which version was it previously compiled with ?

<< I have checked the data being sent and it is correct (it is sent to a PHP script that hasn't changed).   >>

What does the browser's developer tools say ?  Specifically, what does the Network requests look like in the browser's developer tools, especially the response code/data ?

Thanks,

Tim Young
Elevate Software
www.elevatesoft.com
Fri, Nov 18 2016 7:00 PMPermanent Link

Steve Gill

Avatar

Hi TIm,

<< What does the browser's developer tools say ?  Specifically, what does the Network requests look like in the browser's developer tools, especially the response code/data ?  >>

It must have been a server issue because it's working now and I have updated anything. Smile

= Steve
Mon, Nov 21 2016 11:32 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Steve,

<< It must have been a server issue because it's working now and I have updated anything. Smile>>

That was easy. Smile

If you see any other issues, please let me know.

Tim Young
Elevate Software
www.elevatesoft.com
Image