HimaaS
HimaaS

Reputation: 423

HTTP 400 Bad Request while sending more number of characters with the URL to server

I am developing one React application, using the fetch API, I am sending one request along with some query parameters in the URL to server. Getting 400 bad request when the length of the characters in the URL exceeds 7700 characters in the chrome browser.

const requestOptions = {
    method: 'POST',
    headers: { 'Content-Type': 'application/json' },
    body: JSON.stringify({ parametername: parametervalue})
};
fetch(URL, requestOptions)

enter image description here Please help me with how to fix it.

Upvotes: 0

Views: 611

Answers (1)

Shunya Watanabe
Shunya Watanabe

Reputation: 370

What is the maximum length of a URL in different browsers?

According to this, you can't have url that is 7000+ characters long. Consider finding a different way to implement?

Upvotes: 1

Related Questions