上一页 1 ··· 69 70 71 72 73 74 75 76 77 ··· 164 下一页
摘要: using System;using System.Collections.Generic;using System.Security.Cryptography;using System.Configuration;using System.Text;using System.Web;using System.Net;using System.IO;namespace Twitter{ class Auth { const string REQUEST_TOKEN_URL = "https://twitter.com/oauth/request_token"; ... 阅读全文
posted @ 2013-07-25 10:26 火腿骑士 阅读(201) 评论(0) 推荐(0)
摘要: Web API核查表:设计、测试、发布API时需思考的43件事当设计、测试或发布一个新的Web API时,你是在一个原有的复杂系统上构建新的系统。那么至少,你也要建立在HTTP上,而HTTP则是基于TCP/IP创建的、TCP/IP建立在一系列的管道上。当然,你也需要考虑Web服务器、应用程序框架或者是API框架。API从设计到测试以至最终的发布需要经历一个漫长的过程,本文将主要探讨Web API从设计到最终发布,开发者可能忽略或者应该注意的东西。HTTP篇HTTP 1.1规范RFC2616是一个非常大的文档,下面我们节选了一些可能会对API产生影响的内容分享给大家:1.Idempotent方法 阅读全文
posted @ 2013-07-24 11:30 火腿骑士 阅读(192) 评论(0) 推荐(0)
摘要: OAuth 2.0 for MVC, Two Legged ImplementationtdupontFri, Mar 18 2011 9:30 AM13OAuth 1.0 was one complicated beast. The OAuth 2.0 spec greatly simplified things, but that also had the wonderful side effect of rending all of our old OAuth 1.0 code obsolete. They say that "the only thing a pioneer 阅读全文
posted @ 2013-07-24 10:43 火腿骑士 阅读(405) 评论(0) 推荐(0)
摘要: 在上篇文章中我研究了OpenId及DotNetOpenAuth的相关应用,这一篇继续研究OAuth2.https://github.com/DotNetOpenAuthhttp://www.cnblogs.com/ljzforever/archive/2013/04/01/2985456.html 一.什么是OAuth2 OAuth是一种开放认证协议,允许用户让第三方应用访问该用户在某一网站上存储的私密的资源(如照片,视频,联系人列表),而无需将用户名和密码提供给第三方应用.数字2表示现在使用第2代协议. 二.OAuth2中的角色 OAuth2有四种角色 resource owner资源所有者 阅读全文
posted @ 2013-07-24 10:32 火腿骑士 阅读(1756) 评论(1) 推荐(0)
摘要: ou can customize theJsonSerializerSettingsby using theFormatters.JsonFormatter.SerializerSettingsproperty in theHttpConfigurationobject.For example, you could do that in the Application_Start() method:protected void Application_Start(){ HttpConfiguration config = GlobalConfiguration.Configuration... 阅读全文
posted @ 2013-07-24 10:06 火腿骑士 阅读(547) 评论(0) 推荐(0)
摘要: Dog-fooding our API - Authenticationhttp://blog.mirajavora.com/authenticate-web-api-using-access-tokens2013年2月4日With fabrik (my portfolio and blogging startup) only weeks away from launch I'm excited to start blogging about "how we did it".As we're dog-fooding our own API (or " 阅读全文
posted @ 2013-07-24 09:53 火腿骑士 阅读(423) 评论(0) 推荐(0)
摘要: ASP.NET Web API integration testing with in-memory hostinghttp://www.strathweb.com/2012/06/asp-net-web-api-integration-testing-with-in-memory-hosting/http://zamd.net/2012/05/04/claim-based-security-for-asp-net-web-apis-using-dotnetopenauth/In-memory hosting is one of the hidden gems of ASP.NET Web A 阅读全文
posted @ 2013-07-24 09:43 火腿骑士 阅读(349) 评论(0) 推荐(0)
摘要: public HttpWebResponse InitiliazeWebRequest() { string responseData =string.Empty;//string url = GetServerEndPoint();string loginInstance ="url + logincreds";HttpWebRequest request =(HttpWebRequest)WebRequest.Create(loginInstance); request.Method="POST"; requ... 阅读全文
posted @ 2013-07-24 09:37 火腿骑士 阅读(266) 评论(0) 推荐(0)
摘要: Planning real world REST APIhttp://blog.developers.ba/post/2012/03/03/ASPNET-Web-API-Authorization-using-Tokens.aspxWhen you try to plan how to build real world REST API like other major players like Facebook or Foursquare have you will soon realize that all major players use OAuth 2.0 .ASP.NET Web 阅读全文
posted @ 2013-07-24 09:24 火腿骑士 阅读(397) 评论(0) 推荐(0)
摘要: //压缩整个目录下载var projectFolder = Request.Params["folder"] != null ? Request.Params["folder"] : string.Empty; if (!string.IsNullOrWhiteSpace(projectFolder)) { string path = Util.GetMapPath(string.Format("attarch/html/{0}", projectFolder)); Response.Cle... 阅读全文
posted @ 2013-07-24 09:23 火腿骑士 阅读(373) 评论(0) 推荐(0)
上一页 1 ··· 69 70 71 72 73 74 75 76 77 ··· 164 下一页