4
RestSharp를 사용하여 요청에 쿠키를 추가하려고하지만 피들러 2에서 요청에 쿠키가 표시되지 않고 서비스 호출이 실패합니다. RestRequest에 쿠키를 추가하는 트릭이 있습니까?Restsharp on WP 7.1 쿠키 추가
RestRequest rq = new RestRequest(LTV.NowNext(), Method.GET);
rc.AddDefaultParameter(LTV.cookie.Key, LTV.cookie.Value, ParameterType.Cookie);
rc.ExecuteAsync<LTV.nowNext>(rq, (response2) =>
{
if (response2.Data == null)
return;
foreach (LTV.channel channel in response2.Data.channels)
this.Items.Add(new ItemViewModel() { LineOne = channel.name, LineTwo = channel.showing[0].content[0].parent.title, LineThree = channel.showing[1].content[0].parent.title });
});
감사합니다, 알
이 http://stackoverflow.com/questions/6557058/unable-to-send과 동일 ... AddHeader ("쿠키", cookieValuesString)를 사용하여이 문제를 극복 할 수있다 -cookies-with-restsharp-on-windows-phone? –
흠, AddDefaultParameter 및 AddParameter를 테스트했으며 피 들러에서 제대로 작동합니다. LTV.NowNext()와 LTV.nowNext는 무엇입니까? –
LTV.NowNext()는 URI 경로이며 LTV.nowNext는 결과 객체입니다 - 기본적으로 나쁘고 상상력이 부족한 명명 구조 – albal