Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagec#
linenumberstrue
string publicKey = "0c6b33651708eb09c8a8d6036b79d739";
string secretKey = "3025c89ebaab20b71e0e42744239bf50";
string method = "get";
string accept = "application/json, text/javascript, */*"; 
string timestamp = DateTime.UtcNow.ToString("o");	// 2013-11-11T10:15:54.1731069Z
string url = "http://localhost:1260/odata/v1/Orders?$top=10&$filter=CreatedOnUtc gt datetime'2013-02-20T00:00:00'00Z";

First, we create the message representation.

...

It looks like:

get
application/json,
text/javascript, */*
http://localhost:1260/odata/v1/orders?$top=10&$filter=createdonutc gt datetime'2013-02-20t0020T00:00:00'00Z
2013-11-11T10:15:54.1731069Z
0c6b33651708eb09c8a8d6036b79d739

...

User-Agent: My shopping data consumer v.1.0
Accept: application/json,
text/javascript, */*
Accept-Charset: UTF-8
SmartStore-Net-Api-PublicKey: 0c6b33651708eb09c8a8d6036b79d739
SmartStore-Net-Api-Date: 2013-11-11T10:15:54.1731069Z
Authorization: SmNetHmac1 hWce6V2KA0kkB0GBbIK0GSw5QAcS3+vj+m+WN/8k9EE=

...

post
lgifXydL3FhffpTIilkwOw==
application/json,
text/javascript, */*
http://localhost:1260/odata/v1/ordernotes
2013-11-11T19:44:04.9378268Z
0c6b33651708eb09c8a8d6036b79d739

...

User-Agent: My shopping data consumer v.1.0
Accept: application/json,
text/javascript, */*
Accept-Charset: UTF-8
SmartStore-Net-Api-PublicKey: 0c6b33651708eb09c8a8d6036b79d739
SmartStore-Net-Api-Date: 2013-11-11T19:44:04.9378268Z
Content-Type: application/json; charset=utf-8
Content-Length: 100
Content-MD5: lgifXydL3FhffpTIilkwOw==
Authorization: SmNetHmac1 ejKxxtHNJYHCtBglZPg+cbSs3YTrA50pkfTHtVb1PMo=

...

Code Block
languagec#
linenumberstrue
dynamic dynamicJson = JObject.Parse(response);
    
foreach (dynamic customer in dynamicJson.value)
{
	string str = string.Format("{0} {1} {2}", customer.Id, customer.CustomerGuid, customer.Email);
	Debug.WriteLine(str);
}