GET http://localhost:3000/data/posts.json 431 (Request Header Fields Too Large) I am getting an error mentioned above. I am using local server "npm server" (No Xampp or WAMP)
JSON file is downloaded from here "https://gorest.co.in/public-api/users?_format=json&access-token=UrX-V34IN7O-1TV0HEaVUCRUz65B9-ibL6M1" I have downloaded this file on the local server.
My Code is:
const API = './data/posts.json';
componentDidMount(){ fetch(API) .then(response => response.text()) .then( (data) => { console.log("data - ", data) } ) }
Clear Your Cookies Too many cookies in the request can cause a web page to show the HTTP error 431 status instead of its content. Websites often use cookies to store preferences, give relevant content, and keep users signed in. However, clearing the browser cookies helps fix this issue.
The “Bad Request – Request Too Long” error is exclusive to browsers. The typical solution is to clear the cache and cookies in your browser.
1. Clear the cache/cookies of the browser. 2. Close and re-open the browser and try again.
You need to delete all the saved cookies for your localhost:3000.
1-chrome settings
2-on the left menu, click on Privacy and security tab
3-go to "privacy and security" section
4-click on site settings
5-click "view permissions and data stored across sites"
6-find localhost and on the right menu reset data
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With