Module: Gitlab::Patch::HangoutsChatHTTPOverride

Defined in:
lib/gitlab/patch/hangouts_chat_http_override.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#uriObject (readonly)

Returns the value of attribute uri.


6
7
8
# File 'lib/gitlab/patch/hangouts_chat_http_override.rb', line 6

def uri
  @uri
end

Instance Method Details

#post(payload) ⇒ Object


9
10
11
12
13
14
15
16
17
18
# File 'lib/gitlab/patch/hangouts_chat_http_override.rb', line 9

def post(payload)
  httparty_response = Gitlab::HTTP.post(
    uri,
    body: payload.to_json,
    headers: { 'Content-Type' => 'application/json' },
    parse: nil # Disables automatic response parsing
  )
  httparty_response.response
  # The rest of the integration expects a Net::HTTP response
end