title: "Not well formed JSON stream" when using moveto or copyto on file from SharePoint 2013 REST API
body: <p>I am trying to enable file move and copy operations on files in a sharepoint 2013 document library. I have the list and delete operations working but when I try to call /moveto(newfile=...,flags=1) or /copyto(strnewfile,boverwrite=true) I get an error "Not well formed JSON stream". </p>
  
  <p>I have tried the newurl (or strnewurl) both with and without the site prefix (e.g. /sites/dev). I have separately verified that getfilebyserverrelativeurl is in fact returning the file.</p>
  
  <p>Has anyone run into this before?</p>
  
  <pre><code>function copyFile() {
      var executor = new SP.RequestExecutor(appweburl);
      executor.executeAsync({
          url: appweburl + "/_api/SP.AppContextSite(@target)/web" +
              "/getfilebyserverrelativeurl('/sites/dev/Sample1/Customer.dim')" +
              "/copyto(strnewurl='/Sample1/filename.docx',boverwrite=false)" +
              "?@target='" + hostweburl + "'",
          method: "POST",
          headers: {
              "accept": "application/json;odata=verbose",
              "IF-MATCH": "*"
          },
          success: function (data) {
              alert(JSON.stringify(data));
          },
          error: errorHandler
      });
  }
  
  function moveFile() {
      var executor = new SP.RequestExecutor(appweburl);
      executor.executeAsync({
          url: appweburl + "/_api/SP.AppContextSite(@target)/web" +
              "/getfilebyserverrelativeurl('/sites/dev/Sample1/Customer.dim')" +
              "/moveto(newurl='/Sample1/filename.docx',flags=1)" +
              "?@target='" + hostweburl + "'",
          method: "POST",
          headers: {
              "accept": "application/json;odata=verbose",
              "IF-MATCH": "*",
              "X-RequestDigest": $("#__REQUESTDIGEST").val()
          },
          success: function (data) {
              alert(JSON.stringify(data));
          },
          error: errorHandler
      });
  }
  </code></pre>