Skip to content

Commit

Permalink
Remove request wrapping in batch collection POST
Browse files Browse the repository at this point in the history
  • Loading branch information
musale committed Nov 18, 2024
1 parent 6d22af2 commit 765dbfe
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions src/msgraph_core/requests/batch_request_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,16 +106,8 @@ async def _post_batch_collection(

batch_responses = BatchResponseContentCollection()

for batch_request_content in batch_request_content_collection.batches:
request_info = await self.to_post_request_information(batch_request_content)
bytes_content = request_info.content
json_content = bytes_content.decode("utf-8")
updated_str = '{"requests":' + json_content + '}'
updated_bytes = updated_str.encode("utf-8")
request_info.content = updated_bytes
response = await self._request_adapter.send_async(
request_info, BatchResponseContent, error_map or self.error_map
)
for batch_request_content in batch_request_content_collection.get_batch_requests_for_execution():
response = await self.post(batch_request_content, error_map)
batch_responses.add_response(response)

return batch_responses
Expand Down

0 comments on commit 765dbfe

Please sign in to comment.