消费使用Java RESTful API中 [英] Consuming RESTful APIs using Java

查看:221
本文介绍了消费使用Java RESTful API中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你会如何消耗使用Java有可能只是标准包一个RESTful API?对于前:Twitter的API。我知道有很大的Java库来访问它,但你会如何从头开始?

How would you consume a RESTful API using Java with probably just the standard packages? For ex: Twitter API. I know there are great Java libraries to access it, but how would you start from scratch?

推荐答案

好了,有很多方法,你可以使用Java的第三方库,例如使用的Apache HTTP客户端
使用孙新泽西API

Well, there are many ways you could access RESTful API using Java third party libraries, like using Apache Http Client or using Sun Jersey API.

您也可以使用本机java.net.HttpURLConnection中消耗REST服务

You could also use the native java.net.HttpURLConnection to consume REST Services

这篇关于消费使用Java RESTful API中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆