File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -157,14 +157,23 @@ public function execute()
157157 $ boundary = $ this ->generateBoundary ();
158158 $ batchContent = $ this ->buildBatchContent ($ boundary );
159159
160- // Create a custom request for batch operation with proper content type
161- $ request = $ this ->client ->request (
160+ // Store original custom headers to restore them after the batch request
161+ $ originalHeaders = $ this ->client ->getHeaders ();
162+
163+ // Set the correct Content-Type header for batch requests
164+ $ this ->client ->addHeader ('Content-Type ' , "multipart/mixed; boundary= {$ boundary }" );
165+
166+ // Create the batch request
167+ $ response = $ this ->client ->request (
162168 HttpMethod::POST ,
163169 '$batch ' ,
164170 $ batchContent
165171 );
166172
167- return $ request ;
173+ // Restore original custom headers for future requests
174+ $ this ->client ->setHeaders ($ originalHeaders );
175+
176+ return $ response ;
168177 }
169178
170179 /**
You can’t perform that action at this time.
0 commit comments