Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $.ajax({
- method: "POST", // GET | POST | PUT | DELETE ...
- body: JSON.stringify({/* Сюда тело */}), // При GET удалить строчку
- url: "http://localhost:5050/api/users",
- headers: {Authorization: "ТОКЕН", "Content-Type": "application/json"}, // Authorization можно удалить, если не нужен
- success: (data, status, request) => {
- /* data - возвращаемое сервером,
- status - текст статуса,
- request.status - число-статус */
- },
- error: (request, status, error) => {
- /* request.status - число-статус,
- status - текст статуса,
- error - сама ошибка */
- }
- })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement