Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » Elevate Web Builder Technical Support » Support Forums » Elevate Web Builder General » View Thread |
Messages 1 to 4 of 4 total |
Phonegap and Server Request |
Wed, May 23 2018 4:31 AM | Permanent Link |
Pasquale Web Pos srl | I'm trying to use the server request with Phonegap. It works on the notebook but not on the smartphone. Why?
This is a simple test code: procedure TForm1.Button1Click(Sender: TObject); begin ServerRequest1.URL := './hello.php'; ServerRequest1.RequestContent.Clear; ServerRequest1.RequestHeaders.Clear; ServerRequest1.RequestHeaders.Add('Content-Type:application/x-www-form-urlencoded; charset=UTF-8'); ServerRequest1.Execute; end; procedure TForm1.ServerRequest1Complete(Request: TServerRequest); Var Result : String; begin IF ServerRequest1.StatusText = 'OK' Then Begin Result := ServerRequest1.ResponseContent[0]; IF Result = 'Hello' Then Begin Edit1.Text := 'Hello'; End; end; end; |
Wed, May 23 2018 6:38 AM | Permanent Link |
Chris Holland SEC Solutions Ltd. Team Elevate | Hi Passquale,
Have you setup the Whitelist in the phonegap config file? Chris Holland [Team Elevate] On 23/05/2018 09:31, Pasquale wrote: > I'm trying to use the server request with Phonegap. It works on the notebook but not on the smartphone. Why? > This is a simple test code: > procedure TForm1.Button1Click(Sender: TObject); > begin > ServerRequest1.URL := './hello.php'; > > ServerRequest1.RequestContent.Clear; > ServerRequest1.RequestHeaders.Clear; > ServerRequest1.RequestHeaders.Add('Content-Type:application/x-www-form-urlencoded; charset=UTF-8'); > > ServerRequest1.Execute; > > end; > procedure TForm1.ServerRequest1Complete(Request: TServerRequest); > Var > Result : String; > begin > IF ServerRequest1.StatusText = 'OK' Then > Begin > Result := ServerRequest1.ResponseContent[0]; > > IF Result = 'Hello' Then > Begin > Edit1.Text := 'Hello'; > End; > end; > end; > |
Wed, May 23 2018 10:08 AM | Permanent Link |
Pasquale Web Pos srl | I'm using <access origin="*" /> for access to any server |
Wed, May 23 2018 11:30 AM | Permanent Link |
Uli Becker | Pasquale,
> I'm using <access origin="*" /> for access to any server These are the relevant lines I use in my config files: <plugin name="cordova-plugin-whitelist" version="1" /> <access origin="*" /> <allow-intent href="http://*/*" /> <allow-intent href="https://*/*" /> Uli |
This web page was last updated on Friday, December 6, 2024 at 05:39 PM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |