Skip to content
Browse files

Change POST to GET to avoid strange error handling response XML

  • Loading branch information...
1 parent 80d3e20 commit 9566b88015ab53bffbf5356c23283c44506efd71 @AndyHitchman AndyHitchman committed May 17, 2010
Showing with 1 addition and 10 deletions.
  1. +1 −10 src/RPXLib/RPXApiWrapper.cs
View
11 src/RPXLib/RPXApiWrapper.cs
@@ -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);
@@ -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;
}

0 comments on commit 9566b88

Please sign in to comment.
Something went wrong with that request. Please try again.