-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#81: HttpRequestService ability to work with multipart #112
base: master
Are you sure you want to change the base?
Conversation
|
||
protected function getMultipartOptionReplacement(array $data): array | ||
{ | ||
Arr::forget($this->options, 'headers.content-type'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please increase Laravel min version requirements up to 5.7
@@ -127,8 +128,19 @@ public function send(string $method, string $url, array $data = [], array $heade | |||
} | |||
} | |||
|
|||
public function parseMultipart(string $content): StreamedPart |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
public function parseMultipart(string $content): StreamedPart | |
public function multipart(): Generator |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's get content from the response instead
fwrite($stream, $content); | ||
rewind($stream); | ||
|
||
return app()->makeWith(StreamedPart::class, ['stream' => $stream]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return app()->makeWith(StreamedPart::class, ['stream' => $stream]); | |
return app() | |
->makeWith(StreamedPart::class, ['stream' => $stream]) | |
->getParts(); |
} else { | ||
$this->options['body'] = json_encode($data); | ||
} | ||
} | ||
|
||
protected function getMultipartOptionReplacement(array $data): array |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
protected function getMultipartOptionReplacement(array $data): array | |
protected function convertToMultipart(array $data): array |
|
||
protected function getMultipartOptionReplacement(array $data): array | ||
{ | ||
Arr::forget($this->options, 'headers.content-type'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's move this logic out of this function
return $options; | ||
} | ||
|
||
protected function getArrayMultipartOptionReplacement(string $parentKey, array $items): array |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please keep only one method convertToMultipart
with optional parentKey
arg
No description provided.