Skip to content

Commit 765dbfe

Browse files
committed
Remove request wrapping in batch collection POST
1 parent 6d22af2 commit 765dbfe

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

src/msgraph_core/requests/batch_request_builder.py

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -106,16 +106,8 @@ async def _post_batch_collection(
106106

107107
batch_responses = BatchResponseContentCollection()
108108

109-
for batch_request_content in batch_request_content_collection.batches:
110-
request_info = await self.to_post_request_information(batch_request_content)
111-
bytes_content = request_info.content
112-
json_content = bytes_content.decode("utf-8")
113-
updated_str = '{"requests":' + json_content + '}'
114-
updated_bytes = updated_str.encode("utf-8")
115-
request_info.content = updated_bytes
116-
response = await self._request_adapter.send_async(
117-
request_info, BatchResponseContent, error_map or self.error_map
118-
)
109+
for batch_request_content in batch_request_content_collection.get_batch_requests_for_execution():
110+
response = await self.post(batch_request_content, error_map)
119111
batch_responses.add_response(response)
120112

121113
return batch_responses

0 commit comments

Comments
 (0)