Inconsistent network errors on REST API

I’ve been trying to get the RESR API to work consistently from localhost. The URL is working without any browser check limitations, including on Curl, but WeWeb reports a network error when we use it on the browser. It reports
“There is a network error. That can happen when the server you are trying to call is down, or it is not found, or there is a CORS issue because the server expects a call from another server and not a frontend like WeWeb. If the network error is caused by a CORS issue, you may contact the administrator of the API to allow the “weweb.io” domain to make requests or, if this is not possible, consider enabling the “Make this request through a server” option before clicking on “Continue”.”

This goes away after some retries at times, but does not go away in other times. Could someone please help?

Hi @rajaram :wave:

Some REST APIs accept client-side requests, i.e. requests from your users browsers. But many REST APIs, like Twitter, only accept server-side requests.

By default, being a frontend builder, WeWeb’s REST API plugin makes client-side requests. However, you do have the possibility to simulate a server-side request when you enable the “Make this request through a server” option.

Can you tell us more about when you’re getting the Network error? Is it on all your API calls, no matter which API you’re interacting with?

From what I understand, the “Make this request through a server” option fixes the problem on some of your calls but not others. Is there anything that makes those requests different? Are they calling the same API?

Hi @Joyce ,

Thanks for getting back to us. The error happens on both localhost and remote web API calls. The API is currently open to web, so, happy to send you the URL we’re trying 1:1 for support.

Below is the full error stack:

stack: “Error: Network Error at e.exports (https://editor-cdn.weweb.io/public/js/chunk-vendors.7f825e18.js:1:103697) at _.onerror (https://editor-cdn.weweb.io/public/js/chunk-vendors.7f825e18.js:1:98692)”

message: “Network Error”

response: undefined

isAxiosError: true

toJSON: function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}}

configObject

requestObject

Thanks,

It sounds like the issue is coming from a restriction on the API’s side. If you share a link to their documentation, perhaps we can help figure out what’s going on