|
21 | 21 | use Bitbucket\Api\Snippets\Workspaces\Watchers;
|
22 | 22 | use Bitbucket\Api\Snippets\Workspaces\Watching;
|
23 | 23 | use Bitbucket\HttpClient\Message\FileResource;
|
| 24 | +use Bitbucket\HttpClient\Message\ResponseMediator; |
24 | 25 | use Bitbucket\HttpClient\Util\UriBuilder;
|
25 | 26 | use Http\Message\MultipartStream\MultipartStreamBuilder;
|
26 | 27 |
|
@@ -56,7 +57,7 @@ public function create(FileResource $file)
|
56 | 57 | {
|
57 | 58 | $uri = $this->buildWorkspacesUri();
|
58 | 59 | $builder = (new MultipartStreamBuilder())->addResource($file->getName(), $file->getResource(), $file->getOptions());
|
59 |
| - $headers = ['Content-Type' => \sprintf('multipart/form-data; boundary="%s"', $builder->getBoundary())]; |
| 60 | + $headers = [ResponseMediator::CONTENT_TYPE_HEADER => \sprintf('multipart/form-data; boundary="%s"', $builder->getBoundary())]; |
60 | 61 |
|
61 | 62 | return $this->postRaw($uri, $builder->build(), $headers);
|
62 | 63 | }
|
@@ -109,7 +110,7 @@ public function updateFiles(string $snippet, array $files)
|
109 | 110 | $builder->addResource($file->getName(), $file->getResource(), $file->getOptions());
|
110 | 111 | }
|
111 | 112 |
|
112 |
| - $headers = ['Content-Type' => \sprintf('multipart/form-data; boundary="%s"', $builder->getBoundary())]; |
| 113 | + $headers = [ResponseMediator::CONTENT_TYPE_HEADER => \sprintf('multipart/form-data; boundary="%s"', $builder->getBoundary())]; |
113 | 114 |
|
114 | 115 | return $this->postRaw($uri, $builder->build(), $headers);
|
115 | 116 | }
|
|
0 commit comments