Closed lindhor closed 3 years ago
In https://github.com/Esri/geoportal-server-catalog/blob/master/components/CswClient/Pro/CswClient/Common/CswClient.cs#L96 the Content-Type is set to text/xml even if no body is being sent. If I understand it correctly GET requests should not have the Content-Type header specified. We have at least one server that does not allow Content-Type with an empty body.
If I understand the code correctly it would be needed to call SubmitHttpRequest with method DOWNLOAD -or- to make a general exception in SubmitHttpRequest for GET-requests to not set the request.ContentType (i.e. by wrapping the line https://github.com/Esri/geoportal-server-catalog/blob/master/components/CswClient/Pro/CswClient/Common/CswClient.cs#L96 in an if(method.Equals("GET")), which I think is the way to go).
if(method.Equals("GET"))
If I have misunderstood the code and this behaviour is configurable, please let me know.
I think you have the right view on this. if you do decide to make this update, we'd be happy to take a pull request for it!
In https://github.com/Esri/geoportal-server-catalog/blob/master/components/CswClient/Pro/CswClient/Common/CswClient.cs#L96 the Content-Type is set to text/xml even if no body is being sent. If I understand it correctly GET requests should not have the Content-Type header specified. We have at least one server that does not allow Content-Type with an empty body.
If I understand the code correctly it would be needed to call SubmitHttpRequest with method DOWNLOAD -or- to make a general exception in SubmitHttpRequest for GET-requests to not set the request.ContentType (i.e. by wrapping the line https://github.com/Esri/geoportal-server-catalog/blob/master/components/CswClient/Pro/CswClient/Common/CswClient.cs#L96 in an
if(method.Equals("GET"))
, which I think is the way to go).If I have misunderstood the code and this behaviour is configurable, please let me know.