Designing a web service to be used by the iPhone and a web client - ajax

I'm designing a web service that serves up JSON through a REST API. This API is currently being used by an iPhone app to do CRUD operations.
My question is, can I design a web client that uses this REST API using nothing more than ExtJS (or some other RIA framework) and HTML pages? In other words, can I create a static HTML page that uses ExtJS to send AJAX calls to the REST API and receive JSON data from it? Or is this thinking too naive and wrong?

I think this is perfectly acceptable as long as you know that your users browser will be able to handle javascript and AJAX accordingly.

Yes! YES! You can use static html and js files, served by any web server, to build an Ext JS application. Ext JS is very happy to talk REST and JSON to your web service.
Build your Ext JS application outside of ASP.NET MVC. You don't need it.

Related

How can I implement frontend in API without using a framework?

hope you are having a great day.
I will get straight to the point, I have an application in Spring. I am using API calls from postman to retrieve my data.
Now I am asked to implement a front-end but without a framework, I was told that only ajax and javascript should do the trick.
How would I be able to implement this?
Keep in mind it is not an MVC application, but rather an API.
Thanks in advance
Several ways of doing so ! You can use
Javascript
Jquery
Angular JS
Check if below article helps
How to call a REST web service API from JavaScript?

Why do we need Django REST framework since Django templates are available?

I have a question about the REST API and would be thankful if you could help me with it.
As we know, Django provides a template engine along with template tags to include python data types inside a HTML file to present the data to the user. The output will be an HTML file that is sent to the client through HTTP and the browser renders the HTML and presents the data to the user. Keeping this in mind, it is somewhat unclear to me why we actually need a REST API. Under what conditions do users prefer to receive a JSON file instead of a HTML file? I know that JSON files have some advantages over HTML, but what I don't understand is when it is needed.
The common cases for using DRF are:
You're creating a public-facing external API for third-party developers to access the data in your site, and you want to output JSON they can use in their apps rather than HTML.
You're doing mobile development and you want your mobile app to make GET/PUT/POST requests to a Django backend, and then have your backend output data (usually as JSON) to the mobile app. Since you don't want to pass back HTML to the mobile app, you use DRF to effectively create a REST API that your mobile app can call.
You're creating a web app, but you don't want to use the Django templating language. Instead you want to use the Django ORM but output everything as JSON and have your frontend created by a JavaScript MVC framework such as React, Backbone, AngularJS, etc. In those cases, you can use DRF to output JSON that the JavaScript framework can process.

How to send and receive data from ASP.NET server to Android

I want to make a Biometric e-voting system.A voter register and cast vote through android app and all other activities are handled in asp.net server.here i want to know how send and receive data from ASP.NET server to Android
Simply put:
Set up RESTful API in ASP.NET server. And in your Android app, consume it with Java (native app) or JavaScript (html app).
Just create an ASP.net Web API project, create Web API controllers and write methods in it and call it from your Java code in Android.
Here's a sample which could be useful to understand what to do:
http://hintdesk.com/how-to-call-asp-net-web-api-service-from-android/

What is the best way to upload files to a WCF service using AJAX and Angular?

I am using AngularJs to submit a form to a Sharepoint WCF service.
What is the best way to upload file attachments using AJAX, supporting all browsers?
The solution is for AngularJs as frontend and NodeJs as backend. but you can also use it with .net and WCF as backend if you are using Angular for ajax request. please follow the link below
https://ciphertrick.com/2015/12/07/file-upload-with-angularjs-and-nodejs/

is it possible to use twitter Bootstrap->front-end + Spring-Hibernate->Backend in a web app that requires storage of session data

I want to create a web app that uses Twitter Bootstrap for the front end, and the backend uses Spring+Hibernate.
Now, some data has to be stored in each user's session-- how do I store/manage such data?
Do I have to use a 3rd party JS framework like Angular (by Google) or some other framework for this purpose?
Also, in such a hybrid app, should I use the JS framework (like Jquery or Angular JS) for storing the data and then send it to the Spring + Hibernate API? What I mean is, I can as well store the object-> relational DB mapping in the js framework, and use Spring only for basic database inserts/updates/selects?
Twitter bootstrap is a CSS framework with some javascript plugins, and is not a language in itself. Using it or not using it will have no impact on what you can/can't use on your backend.
As for sessions; sessions should always be stored server-side... therefore using Bootstrap will have no affect on your implementation of sessions.
Finally, in regards to keeping any of your database logic client side in javascript, NEVER do this. Javascript code can extremely easily be modified by the user, so anything client side should be considered unsecure. Do not ever put anything unsecure in your database.
We can use Twitter Bootstrap for the front end, and Spring MVC -> REST API for the back end...
For simple apps, ex search-only apps we can straightaway create an API and use JQuery to connect to the API and fetch data.
For more complex apps, the problem is that REST APIs dont store session data... For this, however we can use Spring MVC-> REST API as that has support specifically to handle sessions.
Refer http://tedyoung.me/2011/10/19/practical-spring-mvc-part-5-sessions/ that explains how to store session data using Spring MVC- and the front end is a simple HTML/CSS web page.

Resources