def build_request(self):
     request_url = "{0}$batch".format(self.context.service_root_url)
     request = RequestOptions(request_url)
     request.method = HttpMethod.Post
     request.ensure_header('Content-Type', self._content_type)
     request.data = self._prepare_payload().as_bytes()
     return request
示例#2
0
 def build_request(self):
     url = "{0}/$batch".format(self.context.service_root_url())
     request = RequestOptions(url)
     request.method = HttpMethod.Post
     request.ensure_header('Content-Type', "application/json")
     request.ensure_header('Accept', "application/json")
     request.data = self._prepare_payload()
     return request
示例#3
0
 def build_request(self, query):
     """
     :type query: office365.runtime.queries.client_query.ClientQuery
     """
     url = "{0}/$batch".format(self.context.service_root_url())
     request = RequestOptions(url)
     request.method = HttpMethod.Post
     request.ensure_header('Content-Type', "application/json")
     request.ensure_header('Accept', "application/json")
     request.data = self._prepare_payload()
     return request
示例#4
0
 def build_request(self):
     url = "{0}$batch".format(self.context.service_root_url())
     request = RequestOptions(url)
     request.method = HttpMethod.Post
     media_type = "multipart/mixed"
     content_type = "; ".join([
         media_type,
         "boundary={0}".format(self._current_query.current_boundary)
     ])
     request.ensure_header('Content-Type', content_type)
     request.data = self._prepare_payload().as_bytes()
     return request
示例#5
0
    def build_request(self, query):
        """
        Construct a OData v3 Batch request

        :type query: office365.runtime.queries.client_query.ClientQuery
        """
        url = "{0}/$batch".format(self.context.service_root_url())
        request = RequestOptions(url)
        request.method = HttpMethod.Post
        media_type = "multipart/mixed"
        content_type = "; ".join([
            media_type,
            "boundary={0}".format(self.current_query.current_boundary)
        ])
        request.ensure_header('Content-Type', content_type)
        request.data = self._prepare_payload()
        return request