Permalink
Browse files

Fix transform to dict

  • Loading branch information...
1 parent 9d66f77 commit 00d31273ff4784b6070f9d58d890c95d1333cd7f @ilya-chistyakov committed Jun 1, 2012
Showing with 4 additions and 4 deletions.
  1. +2 −2 src/AmazonMWS/Feeds.cs
  2. +2 −2 src/AmazonMWS/MWS.cs
View
@@ -28,7 +28,7 @@ public class Feeds : MWS
/// <param name="purge"></param>
/// <returns></returns>
public TreeWrapper SubmitFeed(string feed, string feedType, string[] marketplaceIds = null,
- string content_type = "text/xml", string purge = "false")
+ string contentType = "text/xml", string purge = "false")
{
var data = new Dictionary<string, string>() {
{"Action", "SubmitFeed"},
@@ -40,7 +40,7 @@ public class Feeds : MWS
var md = CalcMD5(feed);
var headers = new Dictionary<HttpRequestHeader, string>(){
{HttpRequestHeader.ContentMd5, md},
- {HttpRequestHeader.ContentType, content_type},
+ {HttpRequestHeader.ContentType, contentType},
};
return MakeRequest(data, WebRequestMethods.Http.Post, headers, feed);
}
View
@@ -82,7 +82,7 @@ public class MWS
{"Version", this.version},
{"SignatureMethod", "HmacSHA256"},
};
- qParams.Update(extraData.Where(i => string.IsNullOrEmpty(i.Value)) as Dictionary<string, string>);
+ qParams.Update(extraData.Where(i => !string.IsNullOrEmpty(i.Value)).ToDictionary(p => p.Key, p => p.Value));
//TODO add encode('utf-8')
var requestDescription = string.Join("&",
@@ -131,7 +131,7 @@ public TreeWrapper GetServiceStatus()
/// <returns></returns>
public string CalcSignature(string method, string requestDescription)
{
- var sigData = string.Format("{1}\n{2}\n{3}\n{4}",
+ var sigData = string.Join("\n",
method, this.domain.Replace("https://", "").ToLower(), this.uri, requestDescription);
var sigDataAsBytes = ASCIIEncoding.ASCII.GetBytes(sigData);
var hmac = new HMACSHA256(ASCIIEncoding.ASCII.GetBytes(this.secretKey));

0 comments on commit 00d3127

Please sign in to comment.