Search code examples
urlencodeflurlx-www-form-urlencoded

UrlEncoded Serialization for whitespace


I'm fairly new to deal with x-www-form-urlencoded message. However I encountered an different encoding with PostUrlEncodedAsync that I used in Flurl HTTP to encoded whitespace as +, yet if I used other urlencoding it would use %20

e.g item_name: Test Purchase

From Flurl: Test+Purchase

From other UrlEncoded: Test%20Purchase


Solution

  • Either encoding should work, but historically + is and always has been the dominant implementation for x-www-form-urlencoded, so this is how Flurl does it. See discussion here.