и посмотреть медиа
Tester | Interview Questions
и посмотреть медиа
Interview questions for testers.
Interview questions for testers.
AI bot for text-to-speech and voice cloning in Telegram. Create audio using neural network quickly and easily.
Testing questions: ISTQB, Selenium, API. With examples.
🤔 Какой body при 404 ответе от сервера? Когда сервер возвращает ответ с кодом 404 (Not Found), это означает, что запрашиваемый ресурс не найден. Содержимое тела (body) ответа при этом может варьироваться в зависимости от реализации сервера и конкретного приложения, но обычно оно содержит информацию, объясняющую пользователю или клиентскому приложению причину ошибки. HTTP/1.1 404 Not Found Content-Type: text/html; charset=UTF-8 404 Not Found 404 Not Found The requested URL /path/to/resource was not found on this server. JSON-ответ для API с кодом 404 HTTP/1.1 404 Not Found Content-Type: application/json { "error": { "code": 404, "message": "Resource not found", "details": "The requested resource /api/v1/resource was not found on this server." } } 🚩Примеры Node.js с использованием Express const express = require('express'); const app = express(); app.use((req, res, next) => { res.status(404).json({ error: { code: 404, message: "Resource not found", details: `The requested resource ${req.originalUrl} was not found on this server.` } }); }); app.listen(3000, () => { console.log('Server is running on port 3000'); }); Python с использованием Flask from flask import Flask, jsonify app = Flask(__name__) @app.errorhandler(404) def not_found(error): response = jsonify({ "error": { "code": 404, "message": "Resource not found", "details": "The requested resource was not found on this server." } }) response.status_code = 404 return response ifead>
Открыть канал и посмотреть медиаOnly registered users can share their opinion.
Be the first to share your impression of this resource!