@@ 97-105 (lines=9) @@ | ||
94 | * @param array $data |
|
95 | * @param string[] $headers |
|
96 | */ |
|
97 | public function postJsonAsync($url, array $data, array $headers = []) |
|
98 | { |
|
99 | $this->queueManager->push(HttpAsyncJob::getInstance($this->container)->withParams( |
|
100 | 'POST', |
|
101 | $url, |
|
102 | json_encode($data), |
|
103 | array_merge(['Content-type: application/json'], $headers) |
|
104 | )); |
|
105 | } |
|
106 | ||
107 | /** |
|
108 | * Send a POST HTTP request encoded in www-form-urlencoded. |
|
@@ 133-141 (lines=9) @@ | ||
130 | * @param array $data |
|
131 | * @param string[] $headers |
|
132 | */ |
|
133 | public function postFormAsync($url, array $data, array $headers = []) |
|
134 | { |
|
135 | $this->queueManager->push(HttpAsyncJob::getInstance($this->container)->withParams( |
|
136 | 'POST', |
|
137 | $url, |
|
138 | http_build_query($data), |
|
139 | array_merge(['Content-type: application/x-www-form-urlencoded'], $headers) |
|
140 | )); |
|
141 | } |
|
142 | ||
143 | /** |
|
144 | * Make the HTTP request. |