In various places within the developer documentation (error-codes, REST API exception and error handling) we are advised:
414 will be returned when the URI of a GET request exceeds 8KB. To avoid it, check against the length of your query string to see if it exceeds this limit.
How do I check the length of a URI GET request query string in C# to avoid a 414 error?
Solved! Go to Solution.
Of course you can wrap this in a method of a class that extends your HTTP library (whatever that is) as .ensureMaxLength() or whatever.
Not really a Marketo question.
String.Length will return the number of characters in a string and not the size e.g. 8KB. Am I missing something here?
I agree that this isn't really a Marketo question, but since it's advocated as best practice in a few places I thought someone would know the best way to do this.
A URL-encoded String is ASCII. Every internal char in the string becomes 1 byte wide on the wire, e.g. %20 is 3 bytes.
Now you put it that way it does seem rather obvious, thank you.