i try connect banano to jserver 0n other domain, with this code:
i receive this error message
in the jserver handler, i put this line
but I do not succeed
Thanks for your help.
Note: jserver with postman works perfect.
B4X:
Dim response As BANanoFetchResponse
Dim data As String
Dim fo As BANanoFetchOptions
fo.Initialize
fo.Method = "POST"
fo.Body = BANano.ToJson(CreateMap("q":"Conect","p":Array(),"l":0))
fo.Headers = CreateMap("Content-type": "application/json; charset=UTF-8")
Dim fetch As BANanoFetch
fetch.Initialize("http://rocas.noip.us/tmx",fo)
fetch.Then(response)
fetch.Return(response.Text)
fetch.Then(data)
Log(data)
fetch.End ' always end a fetch with this!
i receive this error message
Access to fetch at 'http://rocas.noip.us/tmx' from origin 'http://127.0.0.1:8887' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
in the jserver handler, i put this line
B4X:
resp.SetHeader("Access-Control-Allow-Origin","*")
but I do not succeed
Thanks for your help.
Note: jserver with postman works perfect.