{
    "url": "https://delaparra-services.nl/skills/http-status-debugging",
    "locale": "en",
    "title": "HTTP status debugging | DeLaParra Services",
    "description": "Use when an HTTP request returns an unexpected status code (4xx or 5xx, or a redirect loop), when a user pastes an error like \"419 Page Expired\", \"422 Unprocessable Content\", \"502 Bad Gateway\" or \"CORS error\", or when debugging API calls between a frontend and a Laravel/PHP or Node backend. Finds the cause from the status code, headers and logs before changing code.",
    "alternates": {
        "en": "https://delaparra-services.nl/skills/http-status-debugging",
        "nl": "https://delaparra-services.nl/nl/skills/http-status-debugging"
    },
    "formats": {
        "csv": "https://delaparra-services.nl/skills/http-status-debugging.csv",
        "md": "https://delaparra-services.nl/skills/http-status-debugging.md",
        "json": "https://delaparra-services.nl/skills/http-status-debugging.json",
        "zip": "https://delaparra-services.nl/skills/http-status-debugging.zip",
        "pdf": "https://delaparra-services.nl/skills/http-status-debugging.pdf"
    },
    "downloads": [
        {
            "url": "https://delaparra-services.nl/skills/http-status-debugging.csv",
            "encodingFormat": "text/csv",
            "name": "http-status-debugging.csv"
        },
        {
            "url": "https://delaparra-services.nl/skills/http-status-debugging.json",
            "encodingFormat": "application/json",
            "name": "http-status-debugging.json"
        },
        {
            "url": "https://delaparra-services.nl/skills/http-status-debugging.md",
            "encodingFormat": "text/markdown",
            "name": "http-status-debugging.md"
        },
        {
            "url": "https://delaparra-services.nl/skills/http-status-debugging.pdf",
            "encodingFormat": "application/pdf",
            "name": "http-status-debugging.pdf"
        },
        {
            "url": "https://delaparra-services.nl/skills/http-status-debugging.zip",
            "encodingFormat": "application/zip",
            "name": "http-status-debugging.zip"
        },
        {
            "url": "https://delaparra-services.nl/skills/http-status-debugging/download",
            "encodingFormat": "application/zip",
            "name": "http-status-debugging-files.zip"
        }
    ],
    "markdown": "# HTTP status debugging\n\n \n\nUse when an HTTP request returns an unexpected status code (4xx or 5xx, or a redirect loop), when a user pastes an error like \"419 Page Expired\", \"422 Unprocessable Content\", \"502 Bad Gateway\" or \"CORS error\", or when debugging API calls between a frontend and a Laravel/PHP or Node backend. Finds the cause from the status code, headers and logs before changing code.\n\n \n\n**Licence** MIT\n\n \n\n**Source** delaparra-original\n\n [Download zip](<https://delaparra-services.nl/skills/http-status-debugging/download>)   \n\n# HTTP status debugging\n\n \n\nDiagnose a failing HTTP request by reading the evidence first: status code, response headers, response body and server logs. Do not change code until you can name the cause.\n\n \n\n## Workflow\n\n \n\n1. **Reproduce and capture.** Get the exact request: method, URL, request headers, body. Prefer ` curl -i ` (shows status line and headers) or the browser DevTools Network tab (\"Copy as cURL\"). \n\n```\ncurl -i -X POST https://app.test/api/orders \\\n  -H \"Accept: application/json\" -H \"Content-Type: application/json\" \\\n  -d '{\"product_id\": 1}'\n```\n\n Always send ` Accept: application/json ` to an API. Without it, Laravel returns HTML redirects instead of JSON errors, which hides the real problem. \n1. **Classify the code** using the table below. 4xx means the request is wrong or not allowed; 5xx means the server (or something in front of it) failed. \n1. **Read the server side.** Laravel: ` storage/logs/laravel.log ` (` tail -f `). Nginx: ` /var/log/nginx/error.log `. PHP-FPM: its pool log. Node: process stdout. Docker: ` docker compose logs -f <service> `. \n1. **Form one hypothesis, test it, then fix.** State: \"The 422 happens because field X fails rule Y.\" Verify with a single changed request before editing code. \n1. **Verify the fix** by repeating the exact request from step 1 and confirming the expected status.\n\n \n\n## Status code reference\n\n    Code Usual meaning First things to check     200 / 201 / 204 Success 204 has no body; don't parse JSON from it   301 / 302 Redirect Unexpected redirect to ` /login ` = not authenticated; HTTP→HTTPS loop = proxy/` TrustProxies ` config   304 Not modified Caching via ` ETag `/` If-None-Match `; not an error   400 Malformed request Invalid JSON body, wrong ` Content-Type `   401 Not authenticated Missing/expired token, cookie not sent (` credentials: 'include' `, SameSite)   403 Authenticated but forbidden Policy/Gate denies, file permissions, WAF   404 Route or record not found ` php artisan route:list `, route model binding, trailing slash, wrong base URL   405 Method not allowed GET vs POST mismatch, form method spoofing (` @method('PUT') `)   409 Conflict Duplicate unique key, version conflict   419 Laravel: CSRF token mismatch / session expired ` @csrf ` in form, ` X-XSRF-TOKEN ` header, session domain, ` SESSION_DOMAIN `, Sanctum stateful domains   422 Validation failed Read the ` errors ` object in the JSON body; match field names   429 Rate limited ` Retry-After ` header, throttle middleware   500 Unhandled server error Log file stack trace; never guess without it   502 Bad gateway Upstream (PHP-FPM, Node, container) crashed or not listening; check upstream logs and port   503 Unavailable Maintenance mode (` php artisan up `), overloaded, health check failing   504 Gateway timeout Slow query or external call; check timeouts on proxy and PHP    \n\n## CORS errors\n\n \n\nA \"CORS error\" in the browser console is not a status code. The browser blocked the response because headers were missing. Check the preflight ` OPTIONS ` request in the Network tab: it needs ` Access-Control-Allow-Origin ` (exact origin when using credentials, not ` * `), ` Access-Control-Allow-Methods ` and ` Access-Control-Allow-Headers `. In Laravel, configure ` config/cors.php `. A CORS error that hides a 500 is common: check the server log too.\n\n \n\n## Rules\n\n \n\n- Never \"fix\" a 4xx/5xx by catching and swallowing the error. \n- Never disable CSRF protection or set CORS to ` * ` with credentials to make an error go away. \n- Report back: request, observed status, cause, fix, verification result.\n\n \n\n## Files\n\n \n\n- ` LICENSE ` \n- ` SKILL.md ` \n- ` SOURCE.md `\n\n \n\n## Related terms\n\n \n\n- [200 OK](<https://delaparra-services.nl/knowledge-hub/200-ok>) \n- [201 Created](<https://delaparra-services.nl/knowledge-hub/201-created>) \n- [204 No Content](<https://delaparra-services.nl/knowledge-hub/204-no-content>) \n- [206 Partial Content](<https://delaparra-services.nl/knowledge-hub/206-partial-content>) \n- [301 Moved Permanently](<https://delaparra-services.nl/knowledge-hub/301-moved-permanently>) \n- [302 Found](<https://delaparra-services.nl/knowledge-hub/302-found>) \n- [304 Not Modified](<https://delaparra-services.nl/knowledge-hub/304-not-modified>) \n- [400 Bad Request](<https://delaparra-services.nl/knowledge-hub/400-bad-request>) \n- [401 Unauthorized](<https://delaparra-services.nl/knowledge-hub/401-unauthorized>) \n- [403 Forbidden](<https://delaparra-services.nl/knowledge-hub/403-forbidden>) \n- [404 Not Found](<https://delaparra-services.nl/knowledge-hub/404-not-found>) \n- [405 Method Not Allowed](<https://delaparra-services.nl/knowledge-hub/405-method-not-allowed>) \n- [409 Conflict](<https://delaparra-services.nl/knowledge-hub/409-conflict>) \n- [422 Unprocessable Entity](<https://delaparra-services.nl/knowledge-hub/422-unprocessable-entity>) \n- [429 Too Many Requests](<https://delaparra-services.nl/knowledge-hub/429-too-many-requests>) \n- [500 Internal Server Error](<https://delaparra-services.nl/knowledge-hub/500-internal-server-error>) \n- [502 Bad Gateway](<https://delaparra-services.nl/knowledge-hub/502-bad-gateway>) \n- [503 Service Unavailable](<https://delaparra-services.nl/knowledge-hub/503-service-unavailable>) \n- [504 Gateway Timeout](<https://delaparra-services.nl/knowledge-hub/504-gateway-timeout>) \n- [API (Application Programming Interface)](<https://delaparra-services.nl/knowledge-hub/api-application-programming-interface>) \n- [CORSError](<https://delaparra-services.nl/knowledge-hub/corserror>) \n- [curl](<https://delaparra-services.nl/knowledge-hub/curl>) \n- [Endpoint](<https://delaparra-services.nl/knowledge-hub/endpoint>) \n- [GraphQL](<https://delaparra-services.nl/knowledge-hub/graphql>) \n- [Payload](<https://delaparra-services.nl/knowledge-hub/payload>) \n- [Polling](<https://delaparra-services.nl/knowledge-hub/polling>) \n- [REST (Representational State Transfer)](<https://delaparra-services.nl/knowledge-hub/rest-representational-state-transfer>) \n- [scp](<https://delaparra-services.nl/knowledge-hub/scp>) \n- [ssh](<https://delaparra-services.nl/knowledge-hub/ssh>) \n- [Webhook](<https://delaparra-services.nl/knowledge-hub/webhook>) \n- [WebSocket](<https://delaparra-services.nl/knowledge-hub/websocket>) \n- [wget](<https://delaparra-services.nl/knowledge-hub/wget>)\n\n \n\n[Installing an agent skill in Claude Code, Codex, Cursor and Copilot](<https://delaparra-services.nl/manuals/een-skill-installeren-in-je-ai-assistent>)\n\n[HTML version](https://delaparra-services.nl/skills/http-status-debugging)\n",
    "structured_data": {
        "@context": "https://schema.org",
        "@graph": [
            {
                "@type": "Organization",
                "@id": "https://delaparra-services.nl/#practice",
                "logo": "https://delaparra-services.nl/logo.png",
                "name": "DeLaParra Services",
                "legalName": "DeLaParra Services",
                "url": "https://delaparra-services.nl/",
                "description": "Bespoke software, web applications and mobile apps, developed in Laravel by a single developer in Groningen. Fixed price agreed in advance, full source code provided upon delivery.",
                "email": "info@delaparra-services.nl",
                "address": {
                    "@type": "PostalAddress",
                    "addressLocality": "Groningen",
                    "addressRegion": "Groningen",
                    "addressCountry": "NL"
                },
                "areaServed": "Groningen, the Netherlands",
                "knowsLanguage": [
                    "en",
                    "nl"
                ],
                "knowsAbout": [
                    "Web design and development",
                    "App development",
                    "Custom software and web applications",
                    "OpenSpec",
                    "AI code review",
                    "Your own coding agent"
                ],
                "founder": {
                    "@id": "https://delaparra-services.nl/#person"
                }
            },
            {
                "@type": "WebPage",
                "@id": "https://delaparra-services.nl/skills/http-status-debugging#webpage",
                "url": "https://delaparra-services.nl/skills/http-status-debugging",
                "name": "HTTP status debugging | DeLaParra Services",
                "description": "Use when an HTTP request returns an unexpected status code (4xx or 5xx, or a redirect loop), when a user pastes an error like \"419 Page Expired\", \"422 Unprocessable Content\", \"502 Bad Gateway\" or \"CORS error\", or when debugging API calls between a frontend and a Laravel/PHP or Node backend. Finds the cause from the status code, headers and logs before changing code.",
                "isPartOf": {
                    "@id": "https://delaparra-services.nl/#website"
                },
                "about": {
                    "@id": "https://delaparra-services.nl/#practice"
                },
                "inLanguage": "en",
                "breadcrumb": {
                    "@id": "https://delaparra-services.nl/skills/http-status-debugging#breadcrumb"
                }
            },
            {
                "@type": "BreadcrumbList",
                "@id": "https://delaparra-services.nl/skills/http-status-debugging#breadcrumb",
                "itemListElement": [
                    {
                        "@type": "ListItem",
                        "position": 1,
                        "name": "Home",
                        "item": "https://delaparra-services.nl/"
                    },
                    {
                        "@type": "ListItem",
                        "position": 2,
                        "name": "HTTP status debugging"
                    }
                ]
            },
            {
                "@type": "Person",
                "@id": "https://delaparra-services.nl/#person",
                "name": "Reinier de la Parra",
                "url": "https://delaparra-services.nl/about"
            },
            {
                "@type": "SoftwareSourceCode",
                "@id": "https://delaparra-services.nl/skills/http-status-debugging#skill",
                "url": "https://delaparra-services.nl/skills/http-status-debugging",
                "name": "HTTP status debugging",
                "description": "Use when an HTTP request returns an unexpected status code (4xx or 5xx, or a redirect loop), when a user pastes an error like \"419 Page Expired\", \"422 Unprocessable Content\", \"502 Bad Gateway\" or \"CORS error\", or when debugging API calls between a frontend and a Laravel/PHP or Node backend. Finds the cause from the status code, headers and logs before changing code.",
                "inLanguage": "en",
                "license": "https://spdx.org/licenses/MIT.html",
                "subjectOf": {
                    "@id": "https://delaparra-services.nl/skills/http-status-debugging#dataset"
                }
            },
            {
                "@type": "Dataset",
                "@id": "https://delaparra-services.nl/skills/http-status-debugging#dataset",
                "name": "HTTP status debugging",
                "description": "Use when an HTTP request returns an unexpected status code (4xx or 5xx, or a redirect loop), when a user pastes an error like \"419 Page Expired\", \"422 Unprocessable Content\", \"502 Bad Gateway\" or \"CORS error\", or when debugging API calls between a frontend and a Laravel/PHP or Node backend. Finds the cause from the status code, headers and logs before changing code.",
                "url": "https://delaparra-services.nl/skills/http-status-debugging",
                "identifier": "https://delaparra-services.nl/skills/http-status-debugging#dataset",
                "about": {
                    "@id": "https://delaparra-services.nl/skills/http-status-debugging#skill"
                },
                "creditText": "delaparra-original",
                "publisher": {
                    "@id": "https://delaparra-services.nl/#practice"
                },
                "license": "https://spdx.org/licenses/MIT.html",
                "isAccessibleForFree": true,
                "inLanguage": "en",
                "dateModified": "2026-11-28T14:03:38+00:00",
                "isPartOf": {
                    "@type": "Dataset",
                    "@id": "https://delaparra-services.nl/knowledge-hub#skills",
                    "name": "Skills for AI coding assistants",
                    "url": "https://delaparra-services.nl/knowledge-hub"
                },
                "includedInDataCatalog": {
                    "@type": "DataCatalog",
                    "@id": "https://delaparra-services.nl/knowledge-hub#catalog",
                    "name": "Knowledge hub data catalog",
                    "url": "https://delaparra-services.nl/knowledge-hub"
                },
                "distribution": [
                    {
                        "@type": "DataDownload",
                        "name": "http-status-debugging.csv",
                        "encodingFormat": "text/csv",
                        "contentUrl": "https://delaparra-services.nl/skills/http-status-debugging.csv",
                        "inLanguage": "en",
                        "dateModified": "2026-11-28T14:03:38+00:00",
                        "license": "https://spdx.org/licenses/MIT.html"
                    },
                    {
                        "@type": "DataDownload",
                        "name": "http-status-debugging.json",
                        "encodingFormat": "application/json",
                        "contentUrl": "https://delaparra-services.nl/skills/http-status-debugging.json",
                        "inLanguage": "en",
                        "dateModified": "2026-11-28T14:03:38+00:00",
                        "license": "https://spdx.org/licenses/MIT.html"
                    },
                    {
                        "@type": "DataDownload",
                        "name": "http-status-debugging.md",
                        "encodingFormat": "text/markdown",
                        "contentUrl": "https://delaparra-services.nl/skills/http-status-debugging.md",
                        "inLanguage": "en",
                        "dateModified": "2026-11-28T14:03:38+00:00",
                        "license": "https://spdx.org/licenses/MIT.html"
                    },
                    {
                        "@type": "DataDownload",
                        "name": "http-status-debugging.pdf",
                        "encodingFormat": "application/pdf",
                        "contentUrl": "https://delaparra-services.nl/skills/http-status-debugging.pdf",
                        "inLanguage": "en",
                        "dateModified": "2026-11-28T14:03:38+00:00",
                        "license": "https://spdx.org/licenses/MIT.html"
                    },
                    {
                        "@type": "DataDownload",
                        "name": "http-status-debugging.zip",
                        "encodingFormat": "application/zip",
                        "contentUrl": "https://delaparra-services.nl/skills/http-status-debugging.zip",
                        "inLanguage": "en",
                        "dateModified": "2026-11-28T14:03:38+00:00",
                        "license": "https://spdx.org/licenses/MIT.html"
                    },
                    {
                        "@type": "DataDownload",
                        "name": "http-status-debugging-files.zip",
                        "encodingFormat": "application/zip",
                        "contentUrl": "https://delaparra-services.nl/skills/http-status-debugging/download",
                        "inLanguage": "en",
                        "dateModified": "2026-11-28T14:03:38+00:00",
                        "license": "https://spdx.org/licenses/MIT.html"
                    }
                ]
            }
        ]
    }
}