Perform a PUT request on the specified endpoint

@param url
@param header
@param payload
@return response body
@throws ApiException
@throws AuthenticationException
960565
public String put(String url, String payload) throws AuthenticationException, ApiException {
		return performRequest(url, "PUT", null, null, payload);
	}
215758
public static HttpResponse put(String urlStr, String body,
            Map<String, String> headers) throws IOException {
        URL url = new URL(urlStr);
        HttpURLConnection urlConnection = (HttpURLConnection) url
                .openConnection();
        urlConnection.addRequestProperty("Accept", "application/json");

        urlConnection.setRequestMethod("PUT");
        if (headers != null) {
            for (Entry<String, String> entry : headers.entrySet()) {
                urlConnection.addRequestProperty(entry.getKey(),
                        entry.getValue());
            }
        }

        if (body != null && body.length() > 0)
            urlConnection.addRequestProperty("Content-Length",
                    Integer.toString(body.length()));
        else
            urlConnection.addRequestProperty("Content-Length", "0");
        urlConnection.setDoOutput(true);

        OutputStream out = urlConnection.getOutputStream();
        if (body != null && body.length() > 0)
            ByteStreams.copy(new ByteArrayInputStream(body.getBytes()), out);

        return getHttpResponse(urlConnection);

    }
548543
def put(path, token, query: {}, payload: {})
      request(:put, path, token, query, payload)
    end
459511
function(method, params, payload) {
        var baseUrl   = (method.base_url || this.spec.base_url).replace(/(\/)$/, '');
        var headers   = {};
        for (var header in method.headers) {
            headers[header] = method.headers[header];
        }
        return simpleHttp.createRequest(this.httpClient, baseUrl + method.path, method.method, headers, params, payload);
    }
953211
def send_request(payload)
      response = @http.post payload
      raise APIError, response unless response.is_a?(Net::HTTPSuccess)
      response
    end
145426
def _put(self, url, data={}):
        """"""
        req = self._session.put(self._api_prefix + url, data=data)
        return self._action(req)
328661
@Override
	public HttpRequest createPayloadSendRequest(PayloadData payload, HttpRequest.Listener<HttpRequest> listener) {
		if (payload == null) {
			throw new IllegalArgumentException("Payload is null");
		}

		HttpRequest request = createPayloadRequest(payload);
		request.addListener(listener);
		return request;
	}
244825
public function put($url, $headers = [], $body = null)
    {
        return $this->send(Method::PUT, $url, $body, $headers);
    }
192748
public void put(byte[] data) throws APIException {
        HttpResponse response = client.put(getUrl(), new ByteArrayEntity(data, ContentType.APPLICATION_OCTET_STREAM));
        HttpClientHelpers.throwIfNotOk(response);
    }
462856
public HttpResponse invoke(String uri, String payload, HttpMethod method, Map<String, String> headers) {
        HttpResponse result = null;
        String url = directoryAddresses + uri;
        try {
            if (method == HttpMethod.PUT) {
                result = HttpUtils.put(url, payload, headers);
            }
        } catch (IOException e) {
            String errMsg = "Send HTTP Request to remote Directory Server failed";
            LOGGER.error(errMsg);
            LOGGER.debug(errMsg, e);
            ServiceDirectoryError sde = new ServiceDirectoryError(ErrorCode.HTTP_CLIENT_ERROR);
            throw new ServiceException(sde, errMsg, e);
        }

        if (result.getHttpCode() < 200 || result.getHttpCode() >= 300) {
            String errorBody = result.getRetBody();

            if(errorBody == null || errorBody.isEmpty()){
                LOGGER.error("Invoke remote directory server failed, status=" + result.getHttpCode()
                        + ", Error Message body is empty.");
                ServiceDirectoryError sde = new ServiceDirectoryError(
                        ErrorCode.REMOTE_DIRECTORY_SERVER_ERROR);
                throw new ServiceException(sde, "Error Message body is empty.");
            }
            ServiceDirectoryError sde = null;
            try {
                sde = (ServiceDirectoryError) serializer
                        .deserialize(errorBody.getBytes(),
                                ServiceDirectoryError.class);
            } catch (IOException  e) {
                String errMsg = "Deserialize error body message failed";
                LOGGER.error(errMsg);
                LOGGER.debug(errMsg + ", messageBody=" + errorBody, e);
                ServiceDirectoryError sde1 = new ServiceDirectoryError(ErrorCode.REMOTE_DIRECTORY_SERVER_ERROR);
                throw new ServiceException(sde1, errMsg, e);
            }

            if (sde != null) {
                throw new ServiceException(sde);
            }
        }
        return result;
    }
513311
def _put_request(self, url, headers, data=None):
        
        return self._session.put(url, headers=headers, data=data)
812768
protected int addPayload(RequestBuilder builder, String payload) {
    if (payload == null || payload.length() == 0) {
      return 0;
    }


    builder.setHeader(HttpHeaders.CONTENT_TYPE, contentType.getMimeType());
    builder.setEntity(new StringEntity(payload, contentType));
    return payload.length();
  }
299397
protected function push($url, array $payload, array $headers)
    {
        $request = [
            'headers' => array_merge(
                ['Content-Type' => 'application/json'],
                $headers
            ),
            'json'       => $payload,
            'exceptions' => false,
        ];

        $this->request('put', $url, $request);
    }
355144
public static String post(String url, String body) {
        return request(HttpRequest.post(replaceLocalHost(url)), body).body();
    }
623396
private function httpPut($url, $payload = [], $query_arguments = [])
    {
        if (!empty($query_arguments)) {
            $url .= '?' . http_build_query($query_arguments);
        }

        $curl = $this->getCurlHandle($url);

        curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'PUT');
        curl_setopt($curl, CURLOPT_HTTPHEADER, ['Content-Type: application/x-www-form-urlencoded']);
        curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($payload));

        return $this->executeCurlRequest($curl, $url);
    }
87090
public ApiResponse<PutUsers> putUsersWithHttpInfo() throws ApiException {
        com.squareup.okhttp.Call call = putUsersValidateBeforeCall(null, null);
        Type localVarReturnType = new TypeToken<PutUsers>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }
174642
public static function put($url, $headers = [], $body = null)
    {
        return Request::create('default')->put($url, $headers, $body);
    }