Skip to contents

http lib adapter registry

Public fields

adapters

list

Methods


Method print()

print method for the HttpLibAdapaterRegistry class

Usage

HttpLibAdapaterRegistry$print(x, ...)

Arguments

x

self

...

ignored


Method register()

Register an http library adapter

Usage

HttpLibAdapaterRegistry$register(x)

Arguments

x

an http lib adapter, e.g., CrulAdapter

Returns

nothing, registers the library adapter


Method clone()

The objects of this class are cloneable with this method.

Usage

HttpLibAdapaterRegistry$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Examples

x <- HttpLibAdapaterRegistry$new()
x$register(CrulAdapter$new())
x
#> <HttpLibAdapaterRegistry> 
#>   CrulAdapter: webmockr:::CrulAdapter
x$adapters
#> [[1]]
#> <CrulAdapter>
#>   Inherits from: <Adapter>
#>   Public:
#>     client: crul
#>     clone: function (deep = FALSE) 
#>     disable: function (quiet = FALSE) 
#>     enable: function (quiet = FALSE) 
#>     handle_request: function (req) 
#>     initialize: function () 
#>     name: CrulAdapter
#>     remove_stubs: function () 
#>   Private:
#>     add_response_sequences: function (stub, response) 
#>     build_request: function (x) 
#>     build_response: function (req, resp) 
#>     build_stub_response: function (stub) 
#>     fetch_request: function (request) 
#>     make_body_diff: function (request_signature) 
#>     make_stub_request_code: function (x) 
#>     mock: function (on) 
#>     pluck_url: function (request) 
#>     request_handler: function (request) 
#>     update_vcr_disk_path: function (response) 
#> 
x$adapters[[1]]$name
#> [1] "CrulAdapter"