Calling Oracle Rest Data Services(ORDS) from React - reactjs

Is it possible to call Oracle Rest Data Services(ORDS) from React JS? I tried using axios and I have received "Network Error" in console, and in network tab I get code 304. I also tried using fetch and get the same http code and in console I have "net::ERR_CERT_COMMON_NAME_INVALID". So, my question is it is even possible to make this call or do I have to find a workaround? Any ideas?
Thanks!

Related

SendGrid issues with React Application

I'm attempting to use sendgrid in my React application to send emails. I keep getting errors: 'can't resolve fs' and can't resolve 'path'. These issues are linked to the node.modules 'node_modules/#sendgrid/helpers/classes'.
I have attempted to remove them. But no luck, anyone else come across this issue?
You are running a backend code on the browser frontend.
Use Server Side rendering with NextJS or use simple NodeJS backend Code to achieve this.

Consume POST data on react

We are calling a payment gateway api and that vendor is sending response with some POST method. Our UI is build in react which is not able to consume that data. How can I do that?
Assuming this is CCAvenue, you will need a server to take that response and redirect you back to React with the necessary details.
If I get your question right, here it's better if they send it using GET. If you want to consume the data then this is the right way.

Firebase Auth js 400 bad request

I have created an web app using React Js and using firebase as database. It's working fine somtime and sometime it throws following error and takes too much time to load the data.
POST https://securetoken.googleapis.com/v1/token?key=AIzaSyDiQyIT5cn5_zyA4777R888g4wgmKeFZOw-dA 400
I am not able to figure out why it's working some time and does not work sometime. I have attached the console error's screen shot.
Even after getting this error I am able to retrive the data and write the data in firebase but it takes too much time to perform the operation.
I would really appriciate if someone could provide solution.
Thanks in advance.

Is it a good practice to use PATCH instead of GET?

I'm working on a project with .net-core backend and react/react-native for frontend/mobile. On frontend we use axios for api client. The problem we've got was with HTTP GET method. We wanted to send GET with data in body instead of URL params as it was easier to parse it in backend, but for some reason axios was having problem with dealing with it this way. Now our current solution is to use PATCH instead of GET and want to ask if it is a good/acceptable practice - and if not, what would be the best workaround for this problem?

Network calls show Error Message on Screen with setFailSilently()

I'm using the network calls and adding the following statements before reading the response.
r.setReadResponseForErrors(true);
r.setFailSilently(true);
NetworkManager.getInstance().addToQueueAndWait(r);
I don't want to show network error on Mobile App to the user but want to read the response code and perform the operation accordingly. Does this order matters? or do I have to setFailSilently() before setReadResponseForErrors? Please advise.
Thanks
You've mentioned this in another question where I literally quoted the code of fail silently...
You probably have a network manager listener probably in your init method where you show a generic error. That's part of the application boilerplate code.

Resources