For the complete documentation index, see llms.txt. This page is also available as Markdown.

Basic implementation

Implementation

The client's implementation is fairly straightforward; it must implement a POST call on its API or service with the following requirements:

  • A POST method that supports a maximum of 10 megabytes of body parser.

Implementation examples

In JavaScript:

const express = require('express');
const bodyParser = require('body-parser');
const app = express();

app.use(bodyParser.json({ limit: '10mb' }));

app.post('/example', (req, res) => {
  // Access the request data through the body
  console.log(req.body);
  res.send('POST request received successfully');
});

In Java:

  1. Import the necessary libraries, such as org.springframework.web.bind.annotation.PostMapping and org.springframework.web.bind.annotation.RequestBody.

  1. Create a route for the POST request and use the annotation @RequestBody to parse the request body.

  1. Set the property spring.servlet.multipart.max-request-size in your application's configuration file (such as application.properties) to set the maximum request size limit.

With these steps, you have created a POST request in Java that supports a body parser of 10 MB. Note that the maximum request size limit can also be set through other options, such as @RequestPart and MultipartConfigElement.

Note that the JSON objects sent by our service may not follow the same order shown in the documentation, and some fields may be null. It is essential to properly parse the received JSON objects. Below is an example of how to parse a JSON string, similar to the one that might be found in the response to a POST request, into a JSON object for consumption:

Last updated