public SendOfferResponse ModifyTradeOffer(ulong partnerSid, string tradeoffermessage,
string serverid, uint tradeofferidCountered, TradeOffer offer, CookieContainer container)
{
const string url = "https://steamcommunity.com/tradeoffer/new/send";
container.Add(new Cookie("bCompletedTradeOfferTutorial", "true") { Domain = "steamcommunity.com" });
string sessionid = (from Cookie cookie in container.GetCookies(new Uri("https://steamcommunity.com"))
where cookie.Name == "sessionid"
select cookie.Value).FirstOrDefault();
var data = new Dictionary<string, string>
{
{"sessionid", sessionid},
{"serverid", serverid},
{"partner", partnerSid.ToString()},
{"tradeoffermessage", tradeoffermessage},
{"json_tradeoffer", JsonConvert.SerializeObject(offer)},
{"captcha", string.Empty},
{"trade_offer_create_params", "{}"},
{"tradeofferid_countered", tradeofferidCountered.ToString()}
};
return _web.Fetch(url, "POST", data, container, false,
"https://steamcommunity.com/tradeoffer/" + tradeofferidCountered + "/")
.DeserializeJson<SendOfferResponse>();
}