We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 121299c commit e451466Copy full SHA for e451466
src/MultipartStreamBuilder.php
@@ -72,6 +72,23 @@ public function __construct($streamFactory = null)
72
}
73
74
75
+ /**
76
+ * Add a resource to the Multipart Stream
77
+ *
78
+ * @param string|resource|\Psr\Http\Message\StreamInterface $resource
79
+ * The filepath, resource or StreamInterface of the data.
80
+ * @param array $headers
81
+ * Additional headers array: ['header-name' => 'header-value'].
82
83
+ * @return MultipartStreamBuilder
84
+ */
85
+ public function addData($resource, array $headers = [])
86
+ {
87
+ $stream = $this->createStream($resource);
88
+ $this->data[] = ['contents' => $stream, 'headers' => $headers];
89
+ return $this;
90
+ }
91
+
92
/**
93
* Add a resource to the Multipart Stream.
94
*
0 commit comments