Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

really new to nextcloud, please help me translate curl into another language. #12635

Closed
leon846666 opened this issue Nov 23, 2018 · 2 comments
Closed
Labels

Comments

@leon846666
Copy link

I am trying to edit user quota by user provisioning API .
It works with CURL like
curl -u admin:1232018ll -X PUT http://localhost/nextcloud/ocs/v1.php/cloud/users/test -H "OCS-APIRequest"true" -d key="quota" -d value="2GB"

it works well,

But I'd like to use it in ajax or postman.
in ajax :

$.ajax({
type:"PUT",
url:"../../../ocs/v1.php/cloud/users/test",
username:"admin",
pssword:"1232018ll",
data:"key=quota&value=2000MB",
processData:false,
contentType:"application/json",
headers:{ "OCS-APIRequest":"true"},
success:function(data){
alert(data);
},error:function(data){
alert("failed")
}
});

return: 401 unauthorized;

using PostMan:

PUT : http://localhost/nextcloud/ocs/v1.php/cloud/users/test

Params: quota 4gb

Authentication : Basic Auth
username:"admin",
pssword:"1232018ll",

Headers:
OCS-APIRequestv:true
ContentType:application/json

return: 401 unauthorized;

What did i miss?

Please help

@nextcloud-bot
Copy link
Member

GitMate.io thinks possibly related issues are #9854 (Nextcloud download problem Help please!), #9871 (Strange Problems In Nextcloud I beg for help!!!), #9866 (Strange Problems In Nextcloud I beg for help!!), #10050 (New in Nextcloud changelog display - for users), and #3911 (Slow Nextcloud).

@violoncelloCH
Copy link
Member

maybe you better want to place your question in the forum at https://help.nextcloud.com because this is just an issue tracker for bugs and feature requests...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants