title: Sending Base64 String To C# MVC Api Got Error
body: <p>I convert a []byte to a base 64 string with this line</p>
  
  <pre><code> filebase64 = Convert.ToBase64String(attachmentcontetn.Content);
  </code></pre>
  
  <p>and i put the filebase64 in a json like this:</p>
  
  <pre><code> "{'RequestId':'" + requestforminst.Id
                                                       + "','filebase64':'" + filebase64 + "'}"
  </code></pre>
  
  <p>and then i send it to a rest api with this method: jsoninput is InputParameter Of RestApi Which contains Base64 Data And Some Additional Data</p>
  
  <pre><code>  string webapiUrl = generalurl;
          using (var client = new WebClient())
          {
              client.Encoding = Encoding.UTF8;
              client.Headers.Add("Content-Type", "application/x-www-form-urlencoded");
  
              string logineusername = username;
              string logineduserpassword = password;
  
              client.Credentials = new NetworkCredential(logineusername, logineduserpassword);
              var result = client.UploadString(webapiUrl, "POST", "=" + jsoninput);
              return result;
  </code></pre>
  
  <p>and in the REST Api I Convert The Base 64 To []byte With this line:</p>
  
  <pre><code>Convert.FromBase64String(modeldata.filebase64)
  </code></pre>
  
  <p>but it gets error of :"Invalid length for a Base-64 char array or string."
  befor calling restapi i checked my base64 data and convert it to []byte and it works correct and in destenition server got the error</p>