API de comentarios
Comentarios en posts. Datos fijos en memoria: los cambios duran hasta que se reinicia la app.
- GET
https://api.testingapis.com/api/CommentsList comments with filtering, sorting, search and pagination. - POST
https://api.testingapis.com/api/CommentsCreate a comment. - GET
https://api.testingapis.com/api/Comments/{id}Get a comment by ID. - DELETE
https://api.testingapis.com/api/Comments/{id}Delete a comment.
Petición de ejemplo
List comments with filtering, sorting, search and pagination. Referencia completa y botón Send (en inglés).
cURL
curl -X GET "https://api.testingapis.com/api/Comments?limit=2"Respuesta · 200 OK
[
{
"id": 1,
"postId": 1,
"userId": 103,
"body": "Great writeup, exactly what I needed.",
"createdAt": "2025-07-01T15:23:00Z"
},
{
"id": 2,
"postId": 1,
"userId": 105,
… (3 more lines)Filtros, ordenación y paginación
El endpoint de lista acepta limit, page, offset, sort, order y q, y cualquier nombre de campo como filtro exacto. Los totales vuelven en la cabecera X-Total-Count. Los cambios se guardan en memoria hasta que se reinicia el servidor, así que los tests pueden crear, cambiar y borrar registros con libertad. Referencia de parámetros de query.