Пример #1
0
    def head(self, query_url, headers={}, query_parameters={}):
        """Create a simple HEAD HttpRequest object for the given parameters

        Args:
            query_url (string): The URL to send the request to.
            headers (dict, optional): The headers for the HTTP Request.
            query_parameters (dict, optional): Query parameters to add in the URL.

        Returns:
            HttpRequest: The generated HttpRequest for the given paremeters.

        """
        return HttpRequest(HttpMethodEnum.HEAD, query_url, headers,
                           query_parameters, None, None)
Пример #2
0
    def post(self,
             query_url,
             headers={},
             query_parameters={},
             parameters={},
             files={}):
        """Create a simple POST HttpRequest object for the given parameters

        Args:
            query_url (string): The URL to send the request to.
            headers (dict, optional): The headers for the HTTP Request.
            query_parameters (dict, optional): Query parameters to add in the URL.
            parameters (dict, optional): Form or body parameters to be included in the body.
            files (dict, optional): Files to be sent with the request.

        Returns:
            HttpRequest: The generated HttpRequest for the given paremeters.

        """
        return HttpRequest(HttpMethodEnum.POST, query_url, headers,
                           query_parameters, parameters, files)