@private legacy support for when MultipartRequest lived directly under Koala
@private legacy support for when Response lived directly under Koala
@private legacy support for when UploadableIO lived directly under Koala
Control which HTTP service framework Koala uses. Primarily used to switch between the mock-request framework used in testing and the live framework used in real life (and live testing). In theory, you could write your own HTTPService module if you need different functionality, but since the switch to {github.com/arsduo/koala/wiki/HTTP-Services Faraday} almost all such goals can be accomplished with middleware.
Allows you to control various Koala configuration options. Notable options:
* server endpoints: you can override any or all the server endpoints (see HTTPService::DEFAULT_SERVERS) if you want to run requests through other servers. * api_version: controls which Facebook API version to use (v1.0, v2.0, etc)
# File lib/koala.rb, line 45 def config @config ||= OpenStruct.new(HTTPService::DEFAULT_SERVERS) end
# File lib/koala.rb, line 34 def configure yield config end
@private Switch the HTTP service – mostly used for testing.
# File lib/koala.rb, line 57 def self.http_service=(service) # if it's a real http_service, use it @http_service = service end
An convenenient alias to ::http_service.make_request.
# File lib/koala.rb, line 63 def self.make_request(path, args, verb, options = {}) http_service.make_request(path, args, verb, options) end
Used for testing.
# File lib/koala.rb, line 50 def reset_config @config = nil end