Just starting out? Need help? Post your questions and find answers here.
ebelouet
 
Posts: 21
Joined: Mon Apr 08, 2019 9:46 am

httprequest

by ebelouet Mon Sep 14, 2020 12:06 pm

HI,

why en this example I don't receive number 12 on debug ?

Code: Select all
 Procedure HttpGetEvent(Success, Result$, UserData)
  If Success
    Debug Result$
    Debug UserData
  Else
    Debug "HTTPRequest(): Error"
  EndIf
EndProcedure

;http://spider.ebconnections.com/request/getVerifLogin.php?&userAdresse=eric&userpwd=marine
;#PB_HTTP_Get #PB_HTTP_Post
    params.s = "?&userAdresse=eric" + "&userpwd=marine"
    HTTPRequest(#PB_HTTP_Post,"http://spider.ebconnections.com/request/getVerifLogin.php",params.s,@HttpGetEvent())


Sincerely
Eric

// Edit: Code-Tags added (Peter)
User avatar
Peter
 
Posts: 774
Joined: Mon Feb 24, 2014 10:17 pm
Location: 127.0.0.1:9080

Re: httprequest

by Peter Mon Sep 14, 2020 2:29 pm

Developer-Console wrote:Access to XMLHttpRequest at 'http://spider.ebconnections.com/request/getVerifLogin.php' from origin 'http://127.0.0.1:9080' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.


Add this one to your getVerifLogin.php

Code: Select all
<?php
  header("Access-Control-Allow-Origin: *");


After deploying your SpiderBasic-Project to spider.ebconnections.com, you should remove this line.

Greetings ... Peter
ebelouet
 
Posts: 21
Joined: Mon Apr 08, 2019 9:46 am

Re: httprequest

by ebelouet Mon Sep 14, 2020 2:43 pm

Hi,

thank you very much, its working very well now.

Eric
Return to Coding Questions

Who is online

Users browsing this forum: No registered users and 7 guests