OAuth签名开发包 Signpost
openkk
13年前
<p>Signpost 是一个简单而且直观的使用 OAuth 1.0 规范对 HTTP 消息进行签名的 Java 解决方案。支持的 HTTP 客户端包有:</p> <ul> <li>Java HttpURLConnection </li> <li>Apache Commons HTTP 4.x </li> <li>Jetty HTTP Client v6.x</li> </ul> <p>示例代码:</p> <p></p> <pre class="brush:java; toolbar: true; auto-links: false;">// create an HTTP request to a protected resource URL url = new URL("http://api.example.com/protected") HttpURLConnection request = (HttpURLConnection) url.openConnection(); // sign the request (consumer is a Signpost DefaultOAuthConsumer) consumer.sign(request); // send the request request.connect();</pre> <p><strong>项目主页:</strong><a href="http://www.open-open.com/lib/view/home/1324257848765" target="_blank">http://www.open-open.com/lib/view/home/1324257848765</a></p> <p></p>