Trying to update a from in wordpress, created by gravity forms,
using basic auth (https://docs.gravityforms.com/rest-api-v2/#basic-authentication) , I can do
GET but when I try to do
DELETE I am getting this error
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <html> <head> <title>405 Method Not Allowed</title> </head> <body> <h1>Method Not Allowed</h1> <p>The requested method DELETE is not allowed for the URL /wp-json/gf/v2/forms/10.</p> </body> </html>
I can Also do post on https://docs.gravityforms.com/rest-api-v2/#post-forms-form-id-submissions
My Rest API token has read/write permission and have been created by the Admin user.
So what could be wrong with It?
I am using postman for testing.
And this is my code based on Zend Framework 3 :
$request = new Request(); $request->setMethod(Request::METHOD_PUT); $request->setUri($this->apiEndpoint . 'forms/' . $this->formId); $request->getHeaders()->addHeaders([ 'Authorization' => 'Basic ' . base64_encode($this->consumerKey . ':' . $this->consumerSecret), 'Content-Type' => 'application/json', "User-Agent" => "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:67.0) Gecko/20100101 Firefox/67.0", ]); $data = json_encode($this->form); $request->setContent($data); $client = new Client(); $client->setOptions(['timeout' => 60000,]); $response = $client->send($request); $response = $response->getBody();