title: Safely sending base64 encoded string as query parameter
body: <p>In my app, I need to send to a server a base64-encoded string as a query parameter, eg.</p>
  
  <pre><code>&amp;data=AwGZnyx+JUi0PFJoyYSEDpgtlrxP(cut...)==
  </code></pre>
  
  <p>Problem is, anything works just fine when there isn't a plus sign in my string: on the other hand, everytime there's one, the server code doesn't behave correctly.</p>
  
  <p>I noticed there are escaping functions (eg. <code>addingPercentEncoding</code>) but they don't work with the plus sign.</p>
  
  <p>Aside from removing all the pluses "manually" (eg. with a regex), is there anything else I can do?</p>
  
  <p>At the moment anything works fine if I use:</p>
  
  <pre><code>string.replacingOccurrences(of: "+", with: "%2B")
  </code></pre>