|
Download code/code210.jsonl from winapiadmin/tinycodinglm: direct link, hf CLI and curl.
- Browser
- Download file 2.13 kB
-
https://huggingface.co/datasets/winapiadmin/tinycodinglm/resolve/b5bf3ebebe22b46f4f78c2589a5bb814a44293a7/code/code210.jsonl
- Command line
-
hf download hf://datasets/winapiadmin/tinycodinglm@b5bf3ebebe22b46f4f78c2589a5bb814a44293a7/code/code210.jsonl
-
curl -L -o code210.jsonl https://huggingface.co/datasets/winapiadmin/tinycodinglm/resolve/b5bf3ebebe22b46f4f78c2589a5bb814a44293a7/code/code210.jsonl
2.13 kB
| {"type": "session", "harness": "deepseek-harness", "id": "code210", "name": "REST API design principles"} | |
| {"type": "message", "message": {"role": "system", "content": "You are an expert software engineer and technical assistant. You provide accurate, detailed, and practical answers. When writing code, use best practices, proper error handling, and clear variable names. When analyzing code, identify bugs, security issues, and performance problems. You have deep knowledge of C/C++, Windows API, Python, and many other technologies."}} | |
| {"type": "message", "message": {"role": "user", "content": "What are REST API design best practices?"}} | |
| {"type": "message", "message": {"role": "assistant", "content": "**Resource-Based URLs:**\n```\nGET /users # List users\nPOST /users # Create user\nGET /users/{id} # Get user\nPUT /users/{id} # Replace user\nPATCH /users/{id} # Partial update\nDELETE /users/{id} # Delete user\n```\n\n**HTTP Status Codes:**\n- 200 OK - Success\n- 201 Created - Resource created\n- 204 No Content - Success, no body\n- 400 Bad Request - Invalid input\n- 401 Unauthorized - Not authenticated\n- 403 Forbidden - No permission\n- 404 Not Found - Resource missing\n- 409 Conflict - Resource conflict\n- 422 Unprocessable Entity - Validation error\n- 500 Internal Server Error\n\n**Request/Response Format:**\n```json\n// Error response\n{\n \"error\": {\n \"code\": \"VALIDATION_ERROR\",\n \"message\": \"Invalid input\",\n \"details\": [{\"field\": \"email\", \"issue\": \"invalid format\"}]\n }\n}\n\n// Success with pagination\n{\n \"data\": [...],\n \"meta\": {\"page\": 1, \"per_page\": 20, \"total\": 100}\n}\n```\n\n**Best Practices:**\n- Use plural nouns for collections\n- Version in URL: `/v1/users`\n- Use query params for filtering: `?status=active&limit=20`\n- Support conditional requests (ETag, If-None-Match)\n- Rate limiting with headers\n- Comprehensive API docs (OpenAPI/Swagger)\n\n**Tips:**\n- Design for clients, not database\n- Be consistent\n- Handle errors gracefully\n- Monitor API usage\n- Deprecate with notice"}} | |