Skip to main content

Hi,

 

When i try to connect open service: https://gis4.waimatedc.govt.nz/arcgis/rest/services/Public/RoadClosure_Waimate_Active_Planned/MapServer using "Esri ArcGIS Feature Service" reader, I get Python exception error. There is no authentication required as its open service. The fact that I can use HTTPCaller and get the data with query service tells me, this service doesnt require authentication. Am I missing something? I tried few other rest service from this council with no luck. Python Exception <HTTPError>: 403 Client Error: Forbidden for url: does this error means anything to do their IT system infrastructure?

 

Any help would be appreciated?image 

Cheers,

Hey Subodh

 

It looks like Waimate have configure their infrastructure/environment to block any requests with a User-Agent header that contains 'python-request'.

 

When using the readers, the User-Agent passed is 'FME/2023.7.47.23636 python-requests/2.31.0' - it doesn't appear you can change this. However when using the HTTPCaller, you can set the user agent to whatever you want (by default it seems to be empty)

 

You can recreate this pretty easily in Postman. With the default user agent, the request works fine

image 

When you use the FME user agent, it failsimage 

and when you append 'python-request' to the default postman user agent, it also fails

image 

So it looks like your options are either:

  • Use an HTTPCaller instead of the reader, or
  • Contact Waimate and get clarification on why they're blocking that user agent

Reply