title: Sharepoint REST API GetFolderByServerRelativePath returns error when percent sign (%) is used in a folder name
body: <p>I use HTTP post method to upload files, as shown below:</p>
  
  <pre><code>POST https://sitename.sharepoint.com/sites/subsitename/pagename/_api/web/getfolderbyserverrelativepath(decodedurl=@t)/files/addusingpath(overwrite=true,decodedurl=@f)?@t='docs/%24%26%2B%2C%3B%3D%40%23%25%7B++++%7D%5E%7E%5B%5D%60'&amp;@f='new.docx' HTTP/1.1
  
      Authorization: "Bearer " + accessToken
      accept: "application/json;odata=verbose"
      content-type: "application/json;odata=verbose"
  </code></pre>
  
  <p>It works well with any files and folders except folders with the percent sign ("%") in a folder name.
  If destination folder name consists a percent sign ("%") it returns the error with message:</p>
  
  <pre><code>{"error":{"code":"-2147024893, System.IO.DirectoryNotFoundException","message":{"lang":"en-US","value":"File Not Found."}}}
  </code></pre>
  
  <p>I've found the related article: <a href="https://docs.microsoft.com/en-us/sharepoint/dev/solution-guidance/supporting-and-in-file-and-folder-with-the-resourcepath-api" rel="nofollow noreferrer">https://docs.microsoft.com/en-us/sharepoint/dev/solution-guidance/supporting-and-in-file-and-folder-with-the-resourcepath-api</a></p>
  
  <p>Therefore, I tried to use another post method:</p>
  
  <pre><code>POST https://sitename.sharepoint.com/sites/subsitename/pagename/_api/web/getfolderbyserverrelativepath(decodedurl=@t)/files/addstubusingpath(decodedurl=@f)?@t='docs/%24%26%2B%2C%3B%3D%40%23%25%7B++++%7D%5E%7E%5B%5D%60'&amp;@f='new.docx' HTTP/1.1
  
      Authorization: "Bearer " + accessToken
      accept: "application/json;odata=verbose"
      content-type: "application/json;odata=verbose"
  </code></pre>
  
  <p>But I got a response like below:</p>
  
  <pre><code>{"error":{"code":"-1, Microsoft.SharePoint.Client.InvalidClientQueryException","message":{"lang":"en-US","value":"Not well formatted JSON stream."}}}
  </code></pre>
  
  <p>What's wrong here?</p>