Main causes

  • Server doesn't support the expectations stated in the Expect header of the request.

  • Misconfiguration of the server leading to inability to meet the requirements specified in the Expect header.

  • Proxy or intermediary between the client and server that strips or alters headers, affecting the Expect header handling.

  • Client error in setting an unrealistic or unsupported expectation in the Expect header.

# Request example 
curl -X PUT https://sandbox.oxylabs.io/ -H 'Accept: */*;q=0.8' -H 'Accept-Encoding: compress' -H 'User-Agent: AppleWebKit/537.36'

Try Scraper API with 5K results

Common fixes

  • Shorten the URL by reducing the number of query parameters or the length of each parameter.

  • Convert the GET request to a POST request to handle larger amounts of data in the request body instead of the URL.

  • Check and modify server settings to increase the maximum allowable URL length.

  • Review and correct any redirection loops or misconfigurations causing excessive URL length.

# Response example 
HTTP/1.1 417 Expectation Failed
Content-Type: text/html; charset=UTF-8
Content-Length: 49

417 Expectation Failed

Forget HTTP errors with Scraper API

Web scraper API

Self-Service

Public data delivery from a majority of websites

From

49

Useful resources

Python request library
Python Requests Library: 2025 Guide
Authors avatar

Adomas Sulcas

2025-01-02

How to Make HTTP Requests in Node.js With Fetch API visuals
How to Make HTTP Requests in Node.js With Fetch API
author avatar

Augustas Pelakauskas

2024-12-09

How to Send GET Requests With cURL
How to Send GET Requests With cURL
Iveta Vistorskyte avatar

Iveta Vistorskyte

2023-06-09

Get the latest news from data gathering world

I'm interested