Simple try HTTPRequest() [Resolved]

Just starting out? Need help? Post your questions and find answers here.
User avatar
kwai chang caine
Posts: 19
Joined: Tue Feb 25, 2014 8:10 am

Simple try HTTPRequest() [Resolved]

Post by kwai chang caine »

Hello at all

It's the first time i try to use SB since a very long time :oops:
Why i have an error
compiler wrote:HTTPRequest(): Error
with the Fred example

Code: Select all

Procedure HttpGetEvent(Success, Result$, UserData)
    If Success
      Debug Result$
    Else
      Debug "HTTPRequest(): Error"
    EndIf
  EndProcedure
  
  ; Get the content of this file, and display it in the debug window
  ;
  HTTPRequest(#PB_HTTP_Get, "http://www.google.fr", "", @HttpGetEvent())
Have a good day
Last edited by kwai chang caine on Fri Aug 13, 2021 5:10 pm, edited 1 time in total.
plouf
Posts: 194
Joined: Tue Feb 25, 2014 6:01 pm
Location: Athens,Greece

Re: Simple try HTTPRequest()

Post by plouf »

for security reasons browser do NOT allow to to cross load data from one domain to another
i.e. if a site running under google.com tries to reach data from yahoo.com browsers, for security reason prohibit
(in you case is 127.0.0.1 trying to load google.fr )

IF you plan to use internally and/or under a local environment, a possible solution is to install a cors plugin in browser and enable it
similar discusion viewtopic.php?f=6&t=2041&p=7715&hilit=cors
Christos
User avatar
kwai chang caine
Posts: 19
Joined: Tue Feb 25, 2014 8:10 am

Re: Simple try HTTPRequest()

Post by kwai chang caine »

Hello PLOUF :D

It's again this history of CORS :shock:
I lost already one day for try to understand and try to enable CORS in Firefox, without succes :oops:
Finaly i use "CORS Everywhere" for the moment during i found another better solution for do that myself
I read the another thread you give to me the link

Thanks a lot for your quick and precious help 8-)
Have very good day
Post Reply