You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In my case the text representation of this query is 85,249 characters but fails not due to a server issue but Uri.TryCreate reporting its too long to be valid at line 706 of PortalGatewayBase.cs. After some quick testing the limit seems to be 65,519 characters.
To workaround this problem i have simply switched some code around, from this
**bool validUrl = Uri.TryCreate(url, UriKind.Absolute, out Uri uri);**
if (!validUrl)
{
throw new HttpRequestException(string.Format("Not a valid url: {0}", url));
}
if (url.Length > MaximumGetRequestLength)
{
_logger.DebugFormat("Url length {0} is greater than maximum configured {1}, switching to POST.", url.Length, MaximumGetRequestLength);
return await Post<T, TRequest>(requestObject, ct).ConfigureAwait(false);
}
To
if (url.Length > MaximumGetRequestLength)
{
_logger.DebugFormat("Url length {0} is greater than maximum configured {1}, switching to POST.", url.Length, MaximumGetRequestLength);
return await Post<T, TRequest>(requestObject, ct).ConfigureAwait(false);
}
**bool validUrl = Uri.TryCreate(url, UriKind.Absolute, out Uri uri);**
if (!validUrl)
{
throw new HttpRequestException(string.Format("Not a valid url: {0}", url));
}
I haven't found a way to increase the maximum length the .NET framework will support. I'm not if you'd even want to drop the URI validation. I will submit a pull request if you approve of this change.
Cheers.
The text was updated successfully, but these errors were encountered:
Hi,
I have ran into an interesting problem when querying an ArcGIS server with a complex geometry...
In my case the text representation of this query is 85,249 characters but fails not due to a server issue but Uri.TryCreate reporting its too long to be valid at line 706 of PortalGatewayBase.cs. After some quick testing the limit seems to be 65,519 characters.
To workaround this problem i have simply switched some code around, from this
To
I haven't found a way to increase the maximum length the .NET framework will support. I'm not if you'd even want to drop the URI validation. I will submit a pull request if you approve of this change.
Cheers.
The text was updated successfully, but these errors were encountered: