Nextcloud 11 Debian Jessie Apache 2.4 PHP 7
Hi,
I’m using RESTful API with no problems with GET, POST and DELETE methods but having two types of problem with PUT method .
Getting HTTP 401 and Statuscode 997 when using requests module of python and PUT
@classmethod def Put(cls, instruction, params = {}, verbose = False): url = cls.Base_URL + instruction headers = {'OCS-APIRequest' : 'true','Content-Type': 'application/x-www-form-urlencoded'}
r = requests.put(url = url, headers = headers, data = params, auth = (cls.user, cls.password))
return r
Everything is OK when using requests module of python and POST
@classmethod def Post(cls, instruction, params = {}, verbose = False): url = cls.Base_URL + instruction headers = {'OCS-APIRequest' : 'true','Content-Type': 'application/x-www-form-urlencoded'}
r = requests.post(url = url, headers = headers, data = params, auth = (cls.user, cls.password))
return r
or with curl
curl -v -X PUT -H “OCS-APIRequest:true” https://admin:xxx@mynextcloud/ocs/v1.php/cloud/users/CWatts -d key=“quota” -d value=“10G”
Instructions ENABLE or DISABLE ignored with both python and curl
Statuscode is OK but the call has no effect
Thanks for help !
Regards