Skip to content

Commit

Permalink
Merged in AndyHitchmen's changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
troygoode committed Oct 29, 2010
2 parents bcf3d95 + 9566b88 commit 3a6cdff
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/RPXLib.Tests/RPXLib.Tests.csproj
Expand Up @@ -120,4 +120,4 @@
<Target Name="AfterBuild">
</Target>
-->
</Project>
</Project>
13 changes: 2 additions & 11 deletions src/RPXLib/RPXApiWrapper.cs
Expand Up @@ -42,7 +42,7 @@ public string ApiKey
public XElement Call(string methodName, IDictionary<string, string> queryData)
{
string postData = GeneratePostData(queryData);
Uri requestUri = new Uri(BaseUrl + methodName);
Uri requestUri = new Uri(BaseUrl + methodName + "?" + postData);

HttpWebRequest request = BuildApiWebRequest(requestUri, postData);

Expand All @@ -59,19 +59,10 @@ public XElement Call(string methodName, IDictionary<string, string> queryData)
private HttpWebRequest BuildApiWebRequest(Uri requestUri, string postData)
{
HttpWebRequest apiWebRequest = (HttpWebRequest) WebRequest.Create(requestUri);
apiWebRequest.Method = "POST";
apiWebRequest.ContentType = "application/x-www-form-urlencoded";
apiWebRequest.ContentLength = postData.Length;

if (webProxy != null)
apiWebRequest.Proxy = webProxy;

// Write the request
using (var stOut = new StreamWriter(apiWebRequest.GetRequestStream(), Encoding.ASCII))
{
stOut.Write(postData);
stOut.Close();
}
return apiWebRequest;
}

Expand All @@ -96,4 +87,4 @@ private string GeneratePostData(IDictionary<string, string> partialQuery)
return sb.ToString();
}
}
}
}
2 changes: 1 addition & 1 deletion src/RPXLib/RPXLib.csproj
Expand Up @@ -137,4 +137,4 @@
<Target Name="AfterBuild">
</Target>
-->
</Project>
</Project>

0 comments on commit 3a6cdff

Please sign in to comment.