public function testDELETEJSON() { $res = HTTP::delete('http://httpbin.org/delete')->json(array('doing' => 'delete'))->send(); $this->assertFalse($res->error()); $this->assertEquals(200, $res->status()); $this->assertEquals((object) array('doing' => 'delete'), $res->body()->json); }
public static function delete($url, $headers = array(), $auth = false) { $url = self::$config['apiURLPrefix'] . $url; if (self::$apiVersion) { $headers[] = "Zotero-API-Version: " . self::$apiVersion; } if (!$auth && self::$apiKey) { $headers[] = "Authorization: Bearer " . self::$apiKey; } $response = HTTP::delete($url, $headers, $auth); return $response; }
public static function delete($url, $headers = array(), $auth = false) { self::loadConfig(); $url = self::$config['apiURLPrefix'] . $url; $response = HTTP::delete($url, $headers, $auth); return $response; }