Make a PUT API call.

@param path
The GET path. Include the GET parameters after ?
@param params
The parameters to be passed in the body of the call as JSON
@return A JSON object.
@throws APIError
If an error occurs.
971443
public JSONObject put(String path, Map<String, Object> params) throws APIError {
        return request(Verb.PUT, path, params);
    }
885845
@SuppressWarnings("unchecked")
  public String path(T target, Object... params) {
    if (params.length == 0) return path(target, Collections.emptyMap());

    if (params.length == 1 && params[0] instanceof Map<?, ?>) return pathMap(target, (Map<Object, Object>) params[0]);

    if (params.length % 2 == 1) throw new RuntimeException("Missing value for param: " + params[params.length - 1]);

    final Map<Object, Object> map = new HashMap<Object, Object>();
    for (int i = 0; i < params.length; i += 2) {
      final String key   = params[i].toString();
      final String value = params[i + 1].toString();
      map.put(key, value);
    }
    return pathMap(target, map);
  }
232630
def put(path, options = {}, headers = {}, raw = false)
      request(:put, path, options, headers, raw)
    end
1120448
def rest_put(url, data, timeout):
    ''''''
    try:
        response = requests.put(url, headers={'Accept': 'application/json', 'Content-Type': 'application/json'},\
                                data=data, timeout=timeout)
        return response
    except Exception as e:
        print('Get exception {0} when sending http put to url {1}'.format(str(e), url))
        return None
903408
public HttpPut createPutMethod(final String path, final Map<String, List<String>> params) {
        return new HttpPut(repositoryURL + path + queryString(params));
    }
981355
private String callForJsonString(final String host, final int port, final String path,
      List<Pair<String, String>> paramList) throws IOException {
    if (paramList == null) {
      paramList = new ArrayList<>();
    }

    @SuppressWarnings("unchecked") final URI uri =
        ExecutorApiClient.buildUri(host, port, path, true);

    return this.apiClient.httpPost(uri, paramList);
  }
256112
def post(path, params = {})
      uri = URI.join(API_DOMAIN, path + "?access_token=#{token}")

      req = Net::HTTP::Post.new(uri)
      req.set_form_data(params)

      res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |https|
        https.request(req)
      end
      JSON.parse(res.body)
    end
643351
public function post($path, $params = []){
        $json = json_encode($params);
        
        return $this->_call('POST', $path, $json);
    }
1223328
public String putJson(String endpoint, String params, JSONObject json) throws IOException {
        return this.putJson(endpoint, params, json, "");
    }
1189140
def PUT(self, rest_path_list, **kwargs):
        
        fields = kwargs.pop("fields", None)
        if fields is not None:
            return self._send_mmp_stream("PUT", rest_path_list, fields, **kwargs)
        else:
            return self._request("PUT", rest_path_list, **kwargs)
731653
def put(cls, id, api_key=None, **kwargs):
        """"""
        inst = cls(api_key=api_key)
        endpoint = '/'.join((cls.get_endpoint(), id))
        return inst.request('PUT', endpoint=endpoint, query_params=kwargs)
837638
def get(path, params = {}, header = {})
      _send(Net::HTTP::Get.new(expand_path(path, params), expand_header(header)))
    end
183864
public RestResponse postJson(final String uri, final String params)
            throws IOException, AppPlatformException {
        return requestJson(getPath(uri), HttpPost.METHOD_NAME, params);
    }
1080632
public Response put(String restPath, Object payload, Map<String, String> queryParams) {
		LOG.debug("PUT: {}", restPath);
		return call(HttpMethod.PUT, restPath, Response.class, payload, queryParams);
	}
932504
public function call($path = '', $params = [])
    {
        $default_params = [
            'api_token' => $this->getGuzzleClient()->getConfig('api_token'),
            'aid' => $this->getGuzzleClient()->getConfig('aid'),
        ];

        $params = array_merge($default_params, $params);

        if ($this->getGuzzleClient()->getConfig('method') === 'post') {
            $response = $this->getGuzzleClient()->post('/api/v3' . $path, [
                'verify' => false,
                'form_params' => $params,
            ]);
        } else {
            $response = $this->getGuzzleClient()->get('/api/v3' . $path, [
                'verify' => false,
                'query' => $params,
            ]);
        }
        $data = json_decode($response->getBody()->getContents());

        switch ($data->code) {
            case 401:
            case 404:
                throw new HttpRequestException($data->message);
                break;
            case 400:
            case 805:
            case 5001:
            case 5003:
                throw new InvalidArgumentException($data->message);
                break;
        }

        return $data;
    }
369290
public void put(InputStream is) throws APIException {
        HttpResponse response = client.put(getUrl(), new InputStreamEntity(is, -1, ContentType.APPLICATION_OCTET_STREAM));
        HttpClientHelpers.throwIfNotOk(response);
    }
1151037
public Response post(String restPath, Object payload, Map<String, String> queryParams) {
		LOG.debug("POST: {}", restPath);
		return call(HttpMethod.POST, restPath, Response.class, payload, queryParams);
	}