Make a Direct Request to an OpenID Provider and return the
    result as a Message object.

    @raises openid.fetchers.HTTPFetchingError: if an error is
        encountered in making the HTTP post.

    @rtype: L{openid.message.Message}
551388
def makeKVPost(request_message, server_url):
    
    # XXX: TESTME
    resp = fetchers.fetch(server_url, body=request_message.toURLEncoded())

    # Process response in separate function that can be shared by async code.
    return _httpResponseToMessage(resp, server_url)
747507
def api_post(message, url, name, http_data=None, auth=None):
    
    try:
        import requests
    except ImportError:
        print('requests is required to do api post.', file=sys.stderr)
        sys.exit(1)

    data = {name : message}
    if http_data:
        for var in http_data:
            key, value = var.split('=')
            data[key] = value

    response = requests.post(
        url,
        data=data,
        auth=auth
    )

    if response.status_code != 200:
        raise RuntimeError('Unable to post data')
1075227
def req(self, message_id, timeout):
        ''''''
        return self.send(constants.REQ + ' ' + message_id + ' ' + str(timeout))
25641
def make_reply(self):
        
        return Message(
            to=str(self.sender),
            sender=str(self.to),
            body=self.body,
            thread=self.thread,
            metadata=self.metadata
        )
927571
async def message(request):
    

    msg = request.get('msg')
    if msg is None:
        return request.text("To send a message, go to 0.0.0.0:8000/"
                            "message/?msg='insert message here'.")
    await app.webhook.send(msg)
    return response.text("Send.")
479404
def request(self, method, url, *args):
        
        return self.http.request(method, url, *args)
629342
def sendMessage(self, message, thread_id=None, thread_type=ThreadType.USER):
        
        return self.send(
            Message(text=message), thread_id=thread_id, thread_type=thread_type
        )
1000727
async def send_message(  # type: ignore
        self, request: str, response_expected: bool, **kwargs: Any
    ) -> Response:
        
        headers = dict(self.DEFAULT_HEADERS)
        headers.update(kwargs.pop("headers", {}))

        response = await self.client.fetch(
            self.endpoint, method="POST", body=request, headers=headers, **kwargs
        )

        return Response(response.body.decode(), raw=response)
144823
def send_direct_message_new(self, messageobject):
        
        headers, post_data = API._buildmessageobject(messageobject)
        return bind_api(
            api=self,
            path='/direct_messages/events/new.json',
            method='POST',
            require_auth=True
        )(self, post_data=post_data, headers=headers)
1242223
def _make_request(self, type, path, args, noRetry=False):
        
        response = getattr(requests, type)(path, headers = self._add_auth_headers(_JSON_HEADERS), **args)
        if response.status_code == 200 or response.status_code == 201:
            return response.json()
        elif not noRetry and self._is_expired_response(response) \
          and 'refresh_token' in self.creds:
            try:
                self.exchange_refresh_token()
            except TokenEndpointError:
                raise _rest_error_from_response(response)
            return self._make_request(type, path, args, noRetry = True)
        raise _rest_error_from_response(response)
949576
def send_message(self, threadid, msgFormat, message):
        '''  '''
        # using deprecated v3 message create because of bug in codegen of v4 ( multipart/form-data )
        response, status_code = self.__agent__.Messages.post_v3_stream_sid_message_create(
            sessionToken=self.__session__,
            keyManagerToken=self.__keymngr__,
            sid=threadid,
            message={"format": msgFormat,
                     "message": message}
        ).result()
        self.logger.debug('%s: %s' % (status_code, response))
        return status_code, response
93564
def load_message(message_id)
      response = API::Channel.message(@bot.token, @id, message_id)
      Message.new(JSON.parse(response), @bot)
    rescue RestClient::ResourceNotFound
      nil
    end
1369944
public MessageResponse viewMessage(final String id) throws UnauthorizedException, GeneralException, NotFoundException {
        if (id == null) {
            throw new IllegalArgumentException("Message ID must be specified.");
        }
        return messageBirdService.requestByID(MESSAGESPATH, id, MessageResponse.class);
    }
277866
def request(self, method, uri, **kwargs):
        

        response = make_tm_request(method, uri, auth=self.auth, **kwargs)

        if method == "DELETE" or response.status == 204:
            return response, {}
        else:
            return response, json.loads(response.content.decode("utf-8"))
752605
def _request(self, method, resource_uri, **kwargs):
        
        data = kwargs.get('data')
        response = method(self.API_BASE_URL + resource_uri,
                          json=data, headers=self.headers)
        response.raise_for_status()
        return response.json()
1260557
def _make_request(self, conn, method, url, timeout=_Default,
                      **httplib_request_kw):
        
        self.num_requests += 1

        if timeout is _Default:
            timeout = self.timeout

        conn.request(method, url, **httplib_request_kw)
        conn.sock.settimeout(timeout)
        httplib_response = conn.getresponse()

        log.debug("\"%s %s %s\" %s %s" %
                  (method, url,
                   conn._http_vsn_str, # pylint: disable-msg=W0212
                   httplib_response.status, httplib_response.length))

        return httplib_response
816727
public Message getMessage(MessageId id)
  {
    // Performance note: this method uses a lazy initialization pattern. When
    // a MessageId is first requested, we fetch the data from the ResourceBundle
    // and create a new Message object, which is then cached. On the next 
    // request, we'll use the cached version instead. 
    Message message;
    if (cachedMessages.containsKey(id))
    {
      message = cachedMessages.get(id);
    } 
    else
    {
      message = new Message(id, defaultSeverities.get(id), getMessageAsString(id), getSuggestion(id));
      cachedMessages.put(id, message);
    }

    return message;
  }