I have a weird error and hope someone can point me in the right direction.
I have a backend API which I am running on localhost for Dev purposes. The API works perfectly when I test it using Postman.
It also used to also work perfectly when I was using B4A. Unfortunately, it just stopped working in the middle of a debugging session, for no apparent reason.
Any thoughts on what to do?
Here are the details:
I have a backend API which I am running on localhost for Dev purposes. The API works perfectly when I test it using Postman.
It also used to also work perfectly when I was using B4A. Unfortunately, it just stopped working in the middle of a debugging session, for no apparent reason.
Any thoughts on what to do?
Here are the details:
Error Log:
FINISHED: ApiFetch -> Start Download Job
*** Service (httputils2service) Create ***
** Service (httputils2service) Start **
** Service (httputils2service) Start **
ResponseError. Reason: java.net.ConnectException: Failed to connect to /127.0.0.1:2501, Response:
FINISHED: ApiFetch -> End Download Job
Error: java.net.ConnectException: Failed to connect to /127.0.0.1:2501
ResponseError. Reason: java.net.ConnectException: Failed to connect to /127.0.0.1:2501, Response:
FINISHED: ApiFetch -> End Download Job
Manifest Editor - Workaround for localhost:
' 28 - Non-ssl (non-https) communication is not permitted by default.
' It can be enabled in B4A v9+ by adding this line to the manifest editor:
CreateResourceFromFile(Macro, Core.NetworkClearText)
HttpJob API Fetch Code:
'POST JSON AND FETCH
Dim apiReturn As String
Dim httpJob As HttpJob
httpJob.Initialize("", Me)
httpJob.PostString(apiUrl, jsonPostValue)
httpJob.GetRequest.SetContentType("application/json")
httpJob.GetRequest.SetContentEncoding("gzip, deflate, br")
Log("FINISHED: ApiFetch -> Start Download Job")
Wait For (httpJob) JobDone(httpJob As HttpJob)
Log("FINISHED: ApiFetch -> End Download Job")
If httpJob.Success Then
Log(httpJob.GetString)
apiReturn = httpJob.GetString
Else
Log("Error: " & httpJob.ErrorMessage)
apiReturn = "@network_error"
httpJob.Release
Return apiReturn
End If
httpJob.Release