Skip to content

Commit

Permalink
fix for char '+' synced as space
Browse files Browse the repository at this point in the history
  • Loading branch information
sepich committed Apr 30, 2015
1 parent c3b6244 commit bd7fb0d
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions SynNotes/Sync.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,19 +45,21 @@ private static string Request(string Uri, string Method = "GET", string Data = "
request.ContentType = ContentType;
request.UserAgent = UserAgent;
request.Timeout = 10000; //10sec
Debug.WriteLine("Uri: " + Uri);

// send POST
if (!string.IsNullOrEmpty(Data) && Method == "POST") {
Debug.WriteLine("Headers: " + request.Headers);
Debug.WriteLine("Data: " + Data);
Data=Data.Replace("+","%2B");
var bytes = Encoding.GetEncoding("UTF-8").GetBytes(Data);
request.ContentLength = bytes.Length;
using (var writeStream = request.GetRequestStream()) {
writeStream.Write(bytes, 0, bytes.Length);
}
}
request.CookieContainer = cookies;
Debug.WriteLine("Headers: " + request.Headers);
Debug.WriteLine("Cookies: " + request.CookieContainer.ToString());
Debug.WriteLine("Data: " + Data);


string responseValue;
using (var response = (HttpWebResponse)request.GetResponse()) {
Expand Down

0 comments on commit bd7fb0d

Please sign in to comment.