Put API
Introduction
FrontQL is a lightweight front-end querying language designed to streamline client-server communication for web applications. It simplifies data submission by allowing clients to send exactly what they need to the server. One of the key features of FrontQL is its PUT API, which enables clients to update data on the server using HTTP PUT requests.
The PUT API of FrontQL is based on a structured query language that is both powerful and easy to understand. When a client makes a PUT request to a FrontQL-enabled server, it includes a query parameter that specifies the fields and objects to be updated. The server then processes this query and updates the requested data.
By using the PUT API of FrontQL, developers can reduce the amount of data transferred over the network, minimize the need for multiple API endpoints, and ensure that applications are more performant and scalable.
Example
Here’s a simple example of a FrontQL PUT API request:
Output
This example updates the user with ID 1 in the server and returns the ID of the updated user.
Parameters
body
: object | array
body
- It is required for data submission.
- It is passed to the body of the request.
- This parameter contains the data to be updated. The data can be a single object or an array of objects.
Multiple Updates
- It is possible to update multiple objects in a single request.
- Simply passing an array of objects to the
body
parameter is enough. - The
id
field is required in each object. - Example: