Module: HTTPX::Plugins::ServerSentEvents::InstanceMethods
- Defined in:
- lib/httpx/plugins/server_sent_events.rb,
sig/plugins/server_sent_events.rbs
Instance Method Summary collapse
- #build_request ⇒ Object
-
#request(**options) ⇒ Object
sends a stream request.
Instance Method Details
#build_request ⇒ Object
50 51 52 53 54 55 56 57 |
# File 'lib/httpx/plugins/server_sent_events.rb', line 50 def build_request(*) super.tap do |request| if request..event_stream request.headers["accept"] = "text/event-stream" request.headers["cache-control"] = "no-cache" end end end |
#request(**options) ⇒ Object
sends a stream request.
44 45 46 47 48 |
# File 'lib/httpx/plugins/server_sent_events.rb', line 44 def request(*, **) [:stream] = true if [:event_stream] super end |