| @@ 65-72 (lines=8) @@ | ||
| 62 | * |
|
| 63 | * @return \Psr\Http\Message\ResponseInterface |
|
| 64 | */ |
|
| 65 | protected function post($endpoint, DocumentInterface $document = null) |
|
| 66 | { |
|
| 67 | return $this->client->getHttpClient()->post( |
|
| 68 | $endpoint, |
|
| 69 | self::JSON_CONTENT_TYPE, |
|
| 70 | $document ? $document->toJson() : '[]' |
|
| 71 | ); |
|
| 72 | } |
|
| 73 | ||
| 74 | /** |
|
| 75 | * put |
|
| @@ 82-89 (lines=8) @@ | ||
| 79 | * |
|
| 80 | * @return \Psr\Http\Message\ResponseInterface |
|
| 81 | */ |
|
| 82 | protected function put($endpoint, DocumentInterface $document = null) |
|
| 83 | { |
|
| 84 | return $this->client->getHttpClient()->put( |
|
| 85 | $endpoint, |
|
| 86 | self::JSON_CONTENT_TYPE, |
|
| 87 | $document ? $document->toJson() : '[]' |
|
| 88 | ); |
|
| 89 | } |
|
| 90 | ||
| 91 | /** |
|
| 92 | * patch |
|
| @@ 99-106 (lines=8) @@ | ||
| 96 | * |
|
| 97 | * @return \Psr\Http\Message\ResponseInterface |
|
| 98 | */ |
|
| 99 | protected function patch($endpoint, DocumentInterface $document = null) |
|
| 100 | { |
|
| 101 | return $this->client->getHttpClient()->patch( |
|
| 102 | $endpoint, |
|
| 103 | self::JSON_CONTENT_TYPE, |
|
| 104 | $document ? $document->toJson() : '[]' |
|
| 105 | ); |
|
| 106 | } |
|
| 107 | ||
| 108 | /** |
|
| 109 | * delete |
|
| @@ 116-123 (lines=8) @@ | ||
| 113 | * |
|
| 114 | * @return \Psr\Http\Message\ResponseInterface |
|
| 115 | */ |
|
| 116 | protected function delete($endpoint, DocumentInterface $document = null) |
|
| 117 | { |
|
| 118 | return $this->client->getHttpClient()->delete( |
|
| 119 | $endpoint, |
|
| 120 | self::JSON_CONTENT_TYPE, |
|
| 121 | $document ? $document->toJson() : '[]' |
|
| 122 | ); |
|
| 123 | } |
|
| 124 | } |
|
| 125 | ||