在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:jnunemaker/httparty开源软件地址:https://github.com/jnunemaker/httparty开源编程语言:Ruby 92.7%开源软件介绍:httpartyMakes http fun again! Ain't no party like a httparty, because a httparty don't stop. Install
Requirements
Examples# Use the class methods to get down to business quickly
response = HTTParty.get('http://api.stackexchange.com/2.2/questions?site=stackoverflow')
puts response.body, response.code, response.message, response.headers.inspect
# Or wrap things up in your own class
class StackExchange
include HTTParty
base_uri 'api.stackexchange.com'
def initialize(service, page)
@options = { query: { site: service, page: page } }
end
def questions
self.class.get("/2.2/questions", @options)
end
def users
self.class.get("/2.2/users", @options)
end
end
stack_exchange = StackExchange.new("stackoverflow", 1)
puts stack_exchange.questions
puts stack_exchange.users See the examples directory for even more goodies. Command Line Interfacehttparty also includes the executable
Help and Docs
Contributing
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论