Chapter 7. AJAX
In the current chapter, we will look at some of the tools designed to help us in developing REST APIs. We will use these tools to write missing functionality in our application. At the end of this chapter, we will be able to do the following:
- Edit an existing task
- Mark a task as finished
- Delete a task from the database
Symfony2 is a typical server-side PHP framework, so it does not offer a lot of built-in features to make frontend development easier. Typical issues that you may encounter are as follows:
- Handling translations and routings within JavaScript files
- Easily creating various non-standard HTTP requests such as
PUT
,PATCH
, orDELETE
- Handling multiple response formats (for example, JSON/XML)
- Creating good API documentation
- Testing/verifying API calls and responses
The AJAX calls and, generally, raw API calls are nowadays one of the most popular functionalities you may encounter while developing a web application. Often, you will encounter requirements to support mobile...