Module: Midjourney::HTTP
- Included in:
- Client
- Defined in:
- lib/midjourney/http.rb
Instance Method Summary collapse
Instance Method Details
#get(path:) ⇒ Object
3 4 5 6 7 |
# File 'lib/midjourney/http.rb', line 3 def get(path:) to_json(conn.get(uri(path: path)) do |req| req.headers = headers end&.body) end |
#json_post(path:, parameters:) ⇒ Object
9 10 11 12 13 14 |
# File 'lib/midjourney/http.rb', line 9 def json_post(path:, parameters:) to_json(conn.post(uri(path: path)) do |req| req.headers = headers req.body = parameters.to_json end&.body) end |