Skip to content

Between a _post and a _get, need a fresh client? #107

Description

@dblock

See ruby-grape/grape-with-roar#9.

Doesn't work:

require'hyperclient'client=Hyperclient.new('http://localhost:9292/api')3.timesdo |i|
client.splines._post(spline: {name: i.to_s,reticulated: [true,false].sample})endclient.splines.eachdo |spline|
puts"spline #{spline.id}#{spline.reticulated ? 'is' : 'is not'} reticulated"endclient.splines.each(&:_delete)

Works:

require'hyperclient'client=Hyperclient.new('http://localhost:9292/api')3.timesdo |i|
client.splines._post(spline: {name: i.to_s,reticulated: [true,false].sample})endclient=Hyperclient.new('http://localhost:9292/api')client.splines.eachdo |spline|
puts"spline #{spline.id}#{spline.reticulated ? 'is' : 'is not'} reticulated"endclient=Hyperclient.new('http://localhost:9292/api')client.splines.each(&:_delete)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions