1

How would I make a preflight request with Faraday? It seems there is a name collision.

# Create a connection
conn = Faraday.new('http://example.com')

# GET request
conn.get # => #<Faraday::Response

# POST request
conn.post # => #<Faraday::Response

# OPTIONS request collides?
conn.options # => #<struct Faraday::RequestOptions
Rimian
  • 36,864
  • 16
  • 117
  • 117

1 Answers1

3

As one might see, the syntactic sugar is provided for all methods, save for :options. To perform such a request, one might call the wrapped Connection#run_request directly:

conn.run_request(:options, nil, nil, nil)
Aleksei Matiushkin
  • 119,336
  • 10
  • 100
  • 160