本文整理汇总了C#中RequestSettings.Add方法的典型用法代码示例。如果您正苦于以下问题:C# RequestSettings.Add方法的具体用法?C# RequestSettings.Add怎么用?C# RequestSettings.Add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RequestSettings
的用法示例。
在下文中一共展示了RequestSettings.Add方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetResponseCounts
public Collector GetResponseCounts(long collectorId)
{
try {
const string endPoint = "/surveys/get_response_counts";
var parameters = new RequestSettings();
parameters.Add("collector_id", collectorId.ToString());
var o = MakeApiRequest(endPoint, parameters);
Collector collector = o.ToObject<Collector>();
return collector;
}
catch (Exception e)
{
throw new SurveyMonkeyException("Error communicating with endpoint", e);
}
}
示例2: CreateRecipients
private RecipientReport CreateRecipients(long collectorId, List<Recipient> recipients, object settings)
{
RequestSettings parameters = new RequestSettings();
parameters.Add("collector_id", collectorId.ToString());
parameters.Add("recipients", recipients);
return CreateRecipientsRequest(parameters);
}
示例3: GetResponsesRequest
private List<Response> GetResponsesRequest(long surveyId, List<long> respondents)
{
try
{
const string endPoint = "/surveys/get_responses";
var parameters = new RequestSettings();
parameters.Add("survey_id", surveyId.ToString());
parameters.Add("respondent_ids", respondents.Select(r => r.ToString()));
var o = MakeApiRequest(endPoint, parameters);
List<Response> responses = o.ToObject<List<Response>>();
return responses;
}
catch (Exception e)
{
throw new SurveyMonkeyException("Error communicating with endpoint", e);
}
}
示例4: GetSurveyDetails
public Survey GetSurveyDetails(long surveyId)
{
try {
const string endPoint = "/surveys/get_survey_details";
var parameters = new RequestSettings();
parameters.Add("survey_id", surveyId.ToString());
var o = MakeApiRequest(endPoint, parameters);
JsonDeserializeGetSurveyDetails rawSurvey = o.ToObject<JsonDeserializeGetSurveyDetails>();
Survey survey = rawSurvey.ToSurvey();
return survey;
}
catch (Exception e)
{
throw new SurveyMonkeyException("Error communicating with endpoint", e);
}
}