Sha256: 6609e8b5a47d8e9ac9a32ccbf46212533fffe2e3a91dc56f7d08fe818070f729

Contents?: true

Size: 1.59 KB

Versions: 6863

Compression:

Stored size: 1.59 KB

Contents

# Upgrade guide

## 0.5

### Options

Fix the option names, because some were renamed. The errors should point you in the right direction:

```ruby
Typhoeus.get("www.example.com", follow_location: true)
# Ethon::Errors::InvalidOption: The option: follow_location is invalid.
# Please try followlocation instead of follow_location.
# ... [Backtrace]

Typhoeus.get("www.example.com", followlocation: true).code
#=> 200
```

### Headers

`Response#headers` returns a hash now and replaces `Response#headers_hash`, use `Response#response_headers` for the raw string:

```ruby
Typhoeus.get("www.example.com", followlocation: true).headers
#=> {
#      "date"=>"Tue, 06 Nov 2012 09:07:27 GMT",
#      "server"=>"Apache/2.2.3 (CentOS)",
#      "last-modified"=>"Wed, 09 Feb 2011 17:13:15 GMT",
#      "vary"=>"Accept-Encoding",
#      "connection"=>"close",
#      "content-type"=>"text/html; charset=UTF-8"
#   }

Typhoeus.get("www.example.com", followlocation: true).response_headers
#=> "HTTP/1.0 302 Found\r\nLocation: http://www.iana.org/domains/example/ [...]"
```

### Params vs body

Make sure every request sends proper params and body (especially POST/PUT). `:params` becomes url parameter and `:body` request body. Before params for POST was smashed into the body.

### Configuration

Create a global configuration in case you want to turn on verbose, memoize or block_connection:

```ruby
Typhoeus.configure do |config|
  config.verbose = true
  config.memoize = true
end
```

### Docs

When in doubt, read the [docs](http://rubydoc.info/github/typhoeus/typhoeus/frames/Typhoeus) or the [code](https://www.github.com/typhoeus).

Version data entries

6,863 entries across 6,860 versions & 28 rubygems

Version Path
ory-client-0.0.1.alpha104 vendor/bundle/ruby/2.5.0/gems/typhoeus-1.4.0/UPGRADE.md
ory-client-0.0.1.alpha103 vendor/bundle/ruby/2.5.0/gems/typhoeus-1.4.0/UPGRADE.md
ory-hydra-client-1.11.5 vendor/bundle/ruby/2.5.0/gems/typhoeus-1.4.0/UPGRADE.md
cloudsmith-api-1.30.0 vendor/bundle/ruby/2.6.0/gems/typhoeus-1.4.0/UPGRADE.md
ory-client-0.0.1.alpha101 vendor/bundle/ruby/2.5.0/gems/typhoeus-1.4.0/UPGRADE.md
ory-client-0.0.1.alpha100 vendor/bundle/ruby/2.5.0/gems/typhoeus-1.4.0/UPGRADE.md
ory-hydra-client-1.11.4 vendor/bundle/ruby/2.5.0/gems/typhoeus-1.4.0/UPGRADE.md
ory-client-0.0.1.alpha99 vendor/bundle/ruby/2.5.0/gems/typhoeus-1.4.0/UPGRADE.md
ory-client-0.0.1.alpha98 vendor/bundle/ruby/2.5.0/gems/typhoeus-1.4.0/UPGRADE.md
ory-client-0.0.1.alpha97 vendor/bundle/ruby/2.5.0/gems/typhoeus-1.4.0/UPGRADE.md
ory-client-0.0.1.alpha96 vendor/bundle/ruby/2.5.0/gems/typhoeus-1.4.0/UPGRADE.md
ory-client-0.0.1.alpha95 vendor/bundle/ruby/2.5.0/gems/typhoeus-1.4.0/UPGRADE.md
ory-client-0.0.1.alpha94 vendor/bundle/ruby/2.5.0/gems/typhoeus-1.4.0/UPGRADE.md
ory-client-0.0.1.alpha93 vendor/bundle/ruby/2.5.0/gems/typhoeus-1.4.0/UPGRADE.md
ory-client-0.0.1.alpha92 vendor/bundle/ruby/2.5.0/gems/typhoeus-1.4.0/UPGRADE.md
ory-oathkeeper-client-0.38.20.beta1 vendor/bundle/ruby/2.5.0/gems/typhoeus-1.4.0/UPGRADE.md
ory-client-0.0.1.alpha91 vendor/bundle/ruby/2.5.0/gems/typhoeus-1.4.0/UPGRADE.md
ory-client-0.0.1.alpha90 vendor/bundle/ruby/2.5.0/gems/typhoeus-1.4.0/UPGRADE.md
ory-client-0.0.1.alpha89 vendor/bundle/ruby/2.5.0/gems/typhoeus-1.4.0/UPGRADE.md
ory-client-0.0.1.alpha88 vendor/bundle/ruby/2.5.0/gems/typhoeus-1.4.0/UPGRADE.md