odata - url too long getting 404

Rohan Kumar 1 Reputation point
2021-03-25T19:27:23.493+00:00

Hi Experts,

Good Morning/Afternoon/Evening,

I have a python program making connection to odata and trying to fetch data, precisely following code-

response = session.get(url,
headers={'Authorization': self.api_cred})

url is constructed based on call to metadata and then appending each navigation property to this url so that it looks something like

https://something.example.com/odata/v4/entity_name?$expand=NavigationProperty_1($select=Id),NavigationProperty_2($select=Id),NavigationProperty_n($select=Id)

This url fails with 404 error -

"The resource you are looking for has been removed, had its name changed, or is temporarily unavailable." -

The URL I am using is very long, I have noticed If I trim the url into half something like below - It starts working.

https://something.example.com/odata/v4/entity_name?$expand=NavigationProperty_1($select=Id),NavigationProperty_2($select=Id)

My question is Is there any limitation on the oData end for URL length? I am getting 404 Resource not found with the full url and when I split the url, it is working for me.

Thank you very much in advance! Much appreciated

Not Monitored
Not Monitored
Tag not monitored by Microsoft.
35,959 questions
{count} votes