put

Microsoft Graph API PUT OneDrive/SharePoint

ぐ巨炮叔叔 提交于 2019-12-11 15:44:17
问题 Trying to post a file to a subfolder of the Shared Documents folder. I thought I had the correct syntax down, but I keep getting StatusCode 400 Bad Request. https://graph.microsoft.com/v1.0/sites/xxxxxx.sharepoint.com,495435b4-60c3-49b7-8f6e-1d262a120ae5,0fad9f67-35a8-4c0b-892e-113084058c0a/drives/b!tDVUScNgt0mPbh0mKhIK5WefrQ-oNQtMiS4RMIQFjAqJk9Tt237bQYC9yEkyNOr6/items/01JDP7KXJ7ZSCYHUJC7BFJW2X6BTR4Z4JH:/filename.xlsx:/content where "filename" is the actual filename. I know a GET to the

How to use path parameters in http.put request

≡放荡痞女 提交于 2019-12-11 15:23:18
问题 I want to know how to write the PUT request that sends parameters in the path. For example, dev changed the URL for the PUT request from a using a query string as parameters to using parameters in the path. When params were sent as query, I did something like this: let payload = { product_id: this.productId, customer_id: this.customerId, userGuide_id: this.userGuide } return this._$q((resolve, reject) => { this._$http.put(‘/api/products/customer/mostRecent’, payload) .then((result) => resolve

No PUT post data being received

こ雲淡風輕ζ 提交于 2019-12-11 14:46:56
问题 I am sending out a PUT request to my site via PHP using cURL: $data = array("a" => 'hello'); $ch = curl_init('http://localhost/linetime/user/1'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PUT"); curl_setopt($ch, CURLOPT_POSTFIELDS,http_build_query($data)); $response = curl_exec($ch); var_dump($response); I am then listening for this PUT request, but receiving no data with the request. Please can you tell me where I am going wrong? $putData = '';

Restangular - PUT request payload is being sent as query string parameters

亡梦爱人 提交于 2019-12-11 11:59:19
问题 I'm using rectangular and have something like this: stuffResource = parentResource .one(resources.category, $scope.stuff.category) .one(resources.stuff, $scope.stuff.id) .put($scope.stuff); Now, when the request is sent, my "stuff" object is being sent in the query string instead of the body! What I'm I doing wrong here? 回答1: What you want to do here is use customPUT() instead of the normal put(). stuffResource = parentResource .one(resources.category, $scope.stuff.category) .one(resources

ANGULAR $http.put REST

心已入冬 提交于 2019-12-11 10:25:32
问题 I try to consume a Web service with REST angular ($ http). The GET is OK, but when I try to make a change with $ http.put, the error appears below: XMLHttpRequest cannot load http://10.2.150.238:90/api/Collaborateurs/1. Response for preflight has invalid HTTP status code 405. update function : .factory('UpdateCollaborateur', function ($http, config) { var fac = {}; fac.Update = function (matricule,collaborateur) { return $http.put(config.apiUrl + 'Collaborateurs/'+ matricule, collaborateur);

convert curl request into URLConnection

社会主义新天地 提交于 2019-12-11 09:17:02
问题 I have this cURL request: curl -H 'Accept: application/vnd.twitchtv.v3+json' -H 'Authorization: OAuth <access_token>' \ -X PUT https://api.twitch.tv/kraken/users/<bot_name>/follows/channels/<channel_name> I need to turn it into a Java URLConnection request. This is what I have so far: String url = "https://api.twitch.tv/kraken/?oauth_token=" + bot.botOAuth.substring("oauth:".length()); URL obj = new URL(url); HttpURLConnection conn = (HttpURLConnection) obj.openConnection(); conn

Symfony 4 API Rest PUT : Map data to database entity

我是研究僧i 提交于 2019-12-11 06:36:28
问题 I'm a begginer in Symfony 4 and I'm developing an API Rest. I want to create a PUT resource that can handle many update cases. In my case, I have a user with many properties but I will take an example with 3 properties to keep things simple : User { username, email, password } My PUT resource can be called in order to update Username, update Email or update Password. For example, to update Username, the user of my API will send a PUT request with only username : { username: "New username" }

Should all the fields of a resource and its related resources be passed in a REST API PUT request?

老子叫甜甜 提交于 2019-12-11 05:55:16
问题 Let's say I have a ticket & comment resource. Tickets can have many comments. In your update endpoint HTTP PUT /api/tickets/<ticket_id>/ , should I require the client to pass all the fields of a ticket + ALL its comments when updating a ticket? I asked some developers and some of them said that I should just pass the fields that will be modified since its lighter, faster in terms of performance and easier to use. And some said that I should pass all the fields of a ticket + ALL its comments

python: HTTP PUT with binary data

妖精的绣舞 提交于 2019-12-11 05:39:28
问题 So I adapted urllib2 as suggested by answers to another question: class HttpRequest(urllib2.Request): def __init__(self, *args, **kwargs): self._method = kwargs.pop('method', 'GET') urllib2.Request.__init__(self, *args, **kwargs) def get_method(self): return self._method and it works nicely for PUT with JSON: req = HttpRequest(url=url, method='PUT', data=json.dumps(metadata)) response = urllib2.urlopen(req) but it fails with data= binary data (partial stacktrace below): File "c:\appl\python\2

Bad request using file_get_contents for PUT request in PHP

旧巷老猫 提交于 2019-12-11 04:18:50
问题 This api call works fine using Postman (a REST Client), but when making the request on the server in my GAE application I am currently getting the following error: HTTP request failed! in C:\Projects\app\file.php on line 26 failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request in C:\Projects\app\file.php on line 26 Here is the code from my application, which makes a call to the rest api method /exampleMethod $dataraw = [ 'email' => 'email@ex.com', 'first_name' => 'firstname',