本文整理汇总了C#中HttpClientHelper.Post方法的典型用法代码示例。如果您正苦于以下问题:C# HttpClientHelper.Post方法的具体用法?C# HttpClientHelper.Post怎么用?C# HttpClientHelper.Post使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HttpClientHelper
的用法示例。
在下文中一共展示了HttpClientHelper.Post方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Add
public Address Add(Address address, string authenticationToken)
{
using (var svc = new HttpClientHelper())
{
var result = JsonHelper.DeserializeJson<Address>(svc.Post(Constants.BlogRestUrl, "address", address, authenticationToken));
return result;
}
}
示例2: Add
public Album Add(Album album, string authenticationToken)
{
using (var svc = new HttpClientHelper())
{
var result = JsonHelper.DeserializeJson<Album>(svc.Post(Constants.BlogRestUrl, "album", album, authenticationToken));
return result;
}
}
示例3: AddChatMessage
public ChatMessage AddChatMessage(ChatMessage chatMessage, string authenticationToken)
{
using (var svc = new HttpClientHelper())
{
var result = JsonHelper.DeserializeJson<ChatMessage>(
svc.Post(Constants.BlogRestUrl, "album", chatMessage, authenticationToken));
return result;
}
}
示例4: Add
public User Add(User user, string authenticationToken)
{
using (var svc = new HttpClientHelper())
{
var result = JsonHelper.DeserializeJson<User>(
svc.Post(Constants.BlogRestUrl, "users", user, authenticationToken));
return result;
}
}
示例5: Add
public void Add(int commentId, string username, string authenticationToken)
{
using (var svc = new HttpClientHelper())
{
var commentLikeDummy = new CommentLike();
svc.Post(Constants.BlogRestUrl,
string.Format("comments/likes?commentId={0}&username={1}", commentId, username),
commentLikeDummy, authenticationToken);
}
}
示例6: BatchSavePayNotice
/// <summary>
/// 批量保存缴费通知数据
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public ExecResult BatchSavePayNotice(IList<PayNoticeEntity> list)
{
ExecResult result = new ExecResult();
if (list != null && list.Count > 0)
{
HttpClientHelper clientHelper = new HttpClientHelper();
result = clientHelper.Post<ExecResult, IList<PayNoticeEntity>>(GetAPIUrl(APIConstant.PAYNOTICE_BATCHSAVE), list);
if (result.result == EnumJsonResult.success.ToString())
{
int index = 0;
string returnData = string.Empty;
foreach (var model in list)
{
SiteConfigFacadeAPIService service = new SiteConfigFacadeAPIService();
MessageRecodeEntity logModel = new MessageRecodeEntity();
logModel.MsgType = 1;
logModel.JournalID = model.JournalID;
logModel.SendUser = model.SendUser;
logModel.MsgTitle = model.Title;
logModel.MsgContent = model.Body;
logModel.CID = model.CID;
if (model.PayType == 1)
logModel.SendType = -3;
else if (model.PayType == 2)
logModel.SendType = -4;
IList<Int64> userList = new List<Int64>() { model.AuthorID };
var emailResult = service.SendEmailOrSms(userList, logModel);
index++;
returnData = emailResult.msg;
if (model.IsSms && !string.IsNullOrWhiteSpace(model.SmsContent))
{
logModel.MsgType = 2;
logModel.MsgContent = model.SmsContent;
var smsResult = service.SendEmailOrSms(userList, logModel);
result.msg += smsResult.msg;
}
}
result.msg += returnData + "共计通知 " + index + " 人";
}
}
return result;
}
示例7: GetAllMenuList
/// <summary>
/// 获取所有列表
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public IList<MenuEntity> GetAllMenuList(MenuQuery query)
{
HttpClientHelper clientHelper = new HttpClientHelper();
IList<MenuEntity> listAllMenu = clientHelper.Post<IList<MenuEntity>,MenuQuery>(GetAPIUrl(APIConstant.SYSGETSYSMENUAJAX), query);
IList<MenuEntity> listResult = new List<MenuEntity>();
if (listAllMenu != null)
{
IList<MenuEntity> listRoot = listAllMenu.Where(item => item.PMenuID == 0).ToList<MenuEntity>();
foreach (MenuEntity item in listRoot)
{
item.MenuUrl = SiteConfig.RootPath + item.MenuUrl;
item.IconUrl = SiteConfig.RootPath + item.IconUrl;
IList<MenuEntity> listChild = listAllMenu.Where(p => p.PMenuID == item.MenuID).ToList<MenuEntity>();
if (listChild != null)
{
// 二级
foreach (MenuEntity itemChild in listChild)
{
itemChild.MenuUrl = SiteConfig.RootPath + itemChild.MenuUrl;
itemChild.IconUrl = SiteConfig.RootPath + itemChild.IconUrl;
item.children.Add(itemChild);
// 三级
IList<MenuEntity> lastListChild = listAllMenu.Where(p => p.PMenuID == itemChild.MenuID).ToList<MenuEntity>();
foreach (MenuEntity lastChild in lastListChild)
{
lastChild.MenuUrl = SiteConfig.RootPath + lastChild.MenuUrl;
lastChild.IconUrl = SiteConfig.RootPath + lastChild.IconUrl;
itemChild.children.Add(lastChild);
}
}
}
listResult.Add(item);
}
}
return listResult;
}
示例8: UpdateIssueContentDownloads
/// <summary>
/// 更新期刊内容下载次数
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public bool UpdateIssueContentDownloads(IssueContentQuery model)
{
HttpClientHelper clientHelper = new HttpClientHelper();
bool result = clientHelper.Post<bool, IssueContentQuery>(GetAPIUrl(APIConstant.ISSUECONTENT_UPDATEDOWNLOADS), model);
return result;
}
示例9: DelIssueSubscribe
/// <summary>
/// 删除期刊订阅
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public ExecResult DelIssueSubscribe(IssueSubscribeQuery query)
{
HttpClientHelper clientHelper = new HttpClientHelper();
ExecResult result = clientHelper.Post<ExecResult, IssueSubscribeQuery>(GetAPIUrl(APIConstant.ISSUESUBSCRIBE_DEL), query);
return result;
}
示例10: GetYearVolumeList
/// <summary>
/// 获取年卷设置列表
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public IList<YearVolumeEntity> GetYearVolumeList(YearVolumeQuery query)
{
HttpClientHelper clientHelper = new HttpClientHelper();
IList<YearVolumeEntity> list = clientHelper.Post<IList<YearVolumeEntity>, YearVolumeQuery>(GetAPIUrl(APIConstant.YEARVOLUME_GETLIST), query);
return list;
}
示例11: SetContributionYearIssue
/// <summary>
/// 设置录用稿件的年期
/// </summary>
/// <returns></returns>
public ExecResult SetContributionYearIssue(IssueContentQuery cEntity)
{
HttpClientHelper clientHelper = new HttpClientHelper();
ExecResult result = clientHelper.Post<ExecResult, IssueContentQuery>(GetAPIUrl(APIConstant.ISSUE_SETCONTRIBUTIONYEARISSUE), cEntity);
return result;
}
示例12: GetDoiRegLog
public DoiRegLogEntity GetDoiRegLog(DoiRegLogQuery query)
{
HttpClientHelper clientHelper = new HttpClientHelper();
DoiRegLogEntity model = clientHelper.Post<DoiRegLogEntity, DoiRegLogQuery>(GetAPIUrl(APIConstant.DOIREGLOG_GETDOIREGLOG), query);
return model;
}
示例13: GetHaveRightMenuAjaxByRole
/// <summary>
/// 获取菜单列表,带有权限标示
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public IList<TreeModel> GetHaveRightMenuAjaxByRole(RoleMenuQuery queryRoleMenu)
{
HttpClientHelper clientHelper = new HttpClientHelper();
// 给指定的作者设置了例外的菜单
IDictionary<long, string> dictExceptionRightMenu = new Dictionary<long, string>();
if (queryRoleMenu.AuthorID != null)
{
AuthorMenuRightExceptionEntity authorExecEntity = new AuthorMenuRightExceptionEntity();
authorExecEntity.AuthorID = queryRoleMenu.AuthorID.Value;
authorExecEntity.JournalID = queryRoleMenu.JournalID;
dictExceptionRightMenu = clientHelper.PostAuth<IDictionary<long, string>, AuthorMenuRightExceptionEntity>(GetAPIUrl(APIConstant.SYSGETAUTHOREXCEPTIONRIGHTMENU), authorExecEntity);
}
IList<MenuEntity> listHaveRightMenuList = clientHelper.Post<IList<MenuEntity>, RoleMenuQuery>(GetAPIUrl(APIConstant.SYSGETHAVERIGHTMENULIST), queryRoleMenu);
IList<TreeModel> listResult = new List<TreeModel>();
if (listHaveRightMenuList != null)
{
IList<MenuEntity> listRoot = listHaveRightMenuList.Where(item => item.PMenuID == 0).ToList<MenuEntity>();
TreeModel treeNode = null;
foreach (MenuEntity item in listRoot)
{
treeNode = new TreeModel();
treeNode.key = item.MenuID.ToString();
treeNode.text = item.MenuName;
treeNode.url = SiteConfig.RootPath + item.MenuUrl;
treeNode.icon = SiteConfig.RootPath + item.IconUrl;
treeNode.isexpand = queryRoleMenu.IsExpend;
treeNode.ischecked = dictExceptionRightMenu.ContainsKey(item.MenuID) ? false : true;
IList<MenuEntity> listChild = listHaveRightMenuList.Where(p => p.PMenuID == item.MenuID).ToList<MenuEntity>();
if (listChild != null)
{
// 二级
foreach (MenuEntity itemChild in listChild)
{
TreeModel treeChildNode = new TreeModel();
treeChildNode.key = itemChild.MenuID.ToString();
treeChildNode.text = itemChild.MenuName;
treeChildNode.url = SiteConfig.RootPath + itemChild.MenuUrl;
treeChildNode.icon = SiteConfig.RootPath + itemChild.IconUrl;
treeChildNode.isexpand = queryRoleMenu.IsExpend;
treeChildNode.ischecked = dictExceptionRightMenu.ContainsKey(itemChild.MenuID) ? false : true;
treeNode.children.Add(treeChildNode);
// 三级
IList<MenuEntity> lastListChild = listHaveRightMenuList.Where(p => p.PMenuID == itemChild.MenuID).ToList<MenuEntity>();
foreach (MenuEntity lastChild in lastListChild)
{
TreeModel treeLastNode = new TreeModel();
treeLastNode.key = lastChild.MenuID.ToString();
treeLastNode.text = lastChild.MenuName;
treeLastNode.url = SiteConfig.RootPath + lastChild.MenuUrl;
treeLastNode.icon = SiteConfig.RootPath + lastChild.IconUrl;
treeLastNode.isexpand = queryRoleMenu.IsExpend;
treeLastNode.ischecked = dictExceptionRightMenu.ContainsKey(lastChild.MenuID) ? false : true;
treeChildNode.children.Add(treeLastNode);
}
}
}
listResult.Add(treeNode);
}
}
return listResult;
}
示例14: SaveIssueContent
/// <summary>
/// 保存期刊
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public ExecResult SaveIssueContent(IssueContentEntity model)
{
HttpClientHelper clientHelper = new HttpClientHelper();
ExecResult result = clientHelper.Post<ExecResult, IssueContentEntity>(GetAPIUrl(APIConstant.ISSUECONTENT_SAVE), model);
return result;
}
示例15: DelYearVolume
/// <summary>
/// 删除年卷设置
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public ExecResult DelYearVolume(YearVolumeQuery query)
{
HttpClientHelper clientHelper = new HttpClientHelper();
ExecResult result = clientHelper.Post<ExecResult, YearVolumeQuery>(GetAPIUrl(APIConstant.YEARVOLUME_DEL), query);
return result;
}