Execute a PATCH call against the partial URL.
@param partialUrl The partial URL to build
@param payload The object to use for the PATCH
356124
public void PATCH(String partialUrl, Object payload)
    {    
        URI uri = buildUri(partialUrl);   
        executePatchRequest(uri, payload);
    }
425446
def patch(self, request, *args, **kwargs):
        
        with reversion.create_revision():
            reversion.set_user(request.user)
            reversion.set_comment('changed through the RESTful API from ip %s' % request.META['REMOTE_ADDR'])
            kwargs['partial'] = True
            return self.update(request, *args, **kwargs)
401523
function(url, callback) {
      this.serverURL = url;

      this.handlers.push(function(err) {
        Erroneous.postToServer(err, callback);
      });
    }
1159410
private void readHttpDataChunkByChunk(HttpPostRequestDecoder decoder) {
        try {
            while (decoder.hasNext()) {
                InterfaceHttpData data = decoder.next();
                if (data != null) {
                    // check if current HttpData is a FileUpload and previously set as partial
                    if (partialContent == data) {
                        partialContent = null;
                    }
                    try {
                        // new value
                        writeHttpData(data);
                    } finally {
                        data.release();
                    }
                }
            }
            // Check partial decoding for a FileUpload
            InterfaceHttpData data = decoder.currentPartialHttpData();
            if (data != null) {
                if (partialContent == null) {
                    partialContent = (HttpData) data;
                }
            }
        } catch (HttpPostRequestDecoder.EndOfDataDecoderException e1) {
            // end
        }
    }
239374
private PatchingResult applyPatch(final String patchId, final Patch patch, final IdentityPatchContext context) throws PatchingException, IOException, XMLStreamException {

        final Identity identity = patch.getIdentity();
        final Patch.PatchType patchType = identity.getPatchType();
        final InstallationManager.InstallationModification modification = context.getModification();
        if (patchType == Patch.PatchType.CUMULATIVE) {
            // Invalidate all installed patches (one-off, cumulative) - we never need to invalidate the release base
            final List<String> invalidation = new ArrayList<String>(modification.getPatchIDs());
            if (!invalidation.isEmpty()) {
                try {
                    // Before rolling back the one-off patches, validate that the state until that point is consistent
                    validateRollbackState(invalidation.get(invalidation.size() - 1),
                            modification.getUnmodifiedInstallationState());
                } catch (PatchingException e) {
                    throw e;
                } catch (Exception e) {
                    throw new PatchingException(e);
                }
                // Invalidate the installed patches first
                for (final String rollback : invalidation) {
                    rollback(rollback, context);
                }
            }
        }

        // Add to installed patches list
        modification.addInstalledPatch(patchId);

        // Then apply the current patch
        for (final PatchElement element : patch.getElements()) {
            // Apply the content modifications
            final IdentityPatchContext.PatchEntry target = context.resolveForElement(element);
            final PatchElementProvider provider = element.getProvider();
            final Patch.PatchType elementPatchType = provider.getPatchType();
            final String elementPatchId = element.getId();
            // See if we can skip this element
            if (target.isApplied(elementPatchId)) {
                // TODO if it is already applied, we can just skip the entry (maybe based ont the type of the patch)
                // This needs some further testing, maybe we need to compare our history with the patch if they are consistent
                throw PatchLogger.ROOT_LOGGER.alreadyApplied(elementPatchId);
            }
            // Check upgrade conditions
            checkUpgradeConditions(provider, target);
            apply(elementPatchId, element.getModifications(), target);
            target.apply(elementPatchId, elementPatchType);
        }
        // Apply the patch to the identity
        final IdentityPatchContext.PatchEntry identityEntry = context.getIdentityEntry();
        apply(patchId, patch.getModifications(), identityEntry);
        identityEntry.apply(patchId, patchType);

        // Port forward missing module changes
        if (patchType == Patch.PatchType.CUMULATIVE) {
            portForward(patch, context);
        }

        // We need the resulting version for rollback
        if (patchType == Patch.PatchType.CUMULATIVE) {
            final Identity.IdentityUpgrade upgrade = identity.forType(Patch.PatchType.CUMULATIVE, Identity.IdentityUpgrade.class);
            identityEntry.setResultingVersion(upgrade.getResultingVersion());
        }

        // Execute the tasks
        final IdentityApplyCallback callback = new IdentityApplyCallback(patch, identityEntry.getDirectoryStructure());
        try {
            return executeTasks(context, callback);
        } catch (Exception e) {
            context.cancel(callback);
            throw rethrowException(e);
        }
    }
920683
public function patch($url, $parameters = []) {
        $this->setURL($url);
        $this->setRequestMethod('PATCH');
        $this->setPostFields($parameters);
        $this->setPost(true);

        return $this->run();
    }
42904
public <T> T execute(String url, HttpMethod method, RequestCallback requestCallback,
			ResponseExtractor<T> responseExtractor, Object... urlVariables) throws RestClientException {

		URI expanded = new UriTemplate(url).expand(urlVariables);
		return doExecute(expanded, method, requestCallback, responseExtractor);
	}
84013
public static function post($url, $payload, $contentType = 'Content-Type: application/json') {
		// TODO move constants to global configuration file
		$ch = curl_init ( $url );
		curl_setopt ( $ch, CURLOPT_CUSTOMREQUEST, "POST" );
		curl_setopt ( $ch, CURLOPT_POSTFIELDS, $payload );
		curl_setopt ( $ch, CURLOPT_RETURNTRANSFER, true );
		curl_setopt ( $ch, CURLOPT_HTTPHEADER, array (
				$contentType,
				'Content-Length: ' . strlen ( $payload ) 
		) );
		$result = curl_exec ( $ch );
		return $result;
	}
744597
public void onHttpClientUpgrade() throws Http2Exception {
        if (connection().isServer()) {
            throw connectionError(PROTOCOL_ERROR, "Client-side HTTP upgrade requested for a server");
        }
        if (!prefaceSent()) {
            // If the preface was not sent yet it most likely means the handler was not added to the pipeline before
            // calling this method.
            throw connectionError(INTERNAL_ERROR, "HTTP upgrade must occur after preface was sent");
        }
        if (decoder.prefaceReceived()) {
            throw connectionError(PROTOCOL_ERROR, "HTTP upgrade must occur before HTTP/2 preface is received");
        }

        // Create a local stream used for the HTTP cleartext upgrade.
        connection().local().createStream(HTTP_UPGRADE_STREAM_ID, true);
    }
1336690
public static synchronized void sse(String url) {
        checkStarted();
        instance().endpoints.add(HandlerUtil.sse(url, null));
    }
551593
ArgusResponse executeHttpRequest(RequestType requestType, String url, Object payload) throws IOException {
        url = _endpoint + url;

        String json = payload == null ? null : toJson(payload);

        return ArgusResponse.generateResponse(_doHttpRequest(requestType, url, json));
    }
705773
public static AsyncSearchQueryResult fromHttp429(String payload) {
        SearchStatus status = new DefaultSearchStatus(1L, 1L, 0L);
        SearchMetrics metrics = new DefaultSearchMetrics(0L, 0L, 0d);

        return new DefaultAsyncSearchQueryResult(
                status,
                Observable.<SearchQueryRow>error(new FtsServerOverloadException(payload)),
                Observable.<FacetResult>empty(),
                Observable.just(metrics)
        );
    }
247797
protected TransportResult doit(String method, URI uri, String payload){
		HttpURLConnection httpConnection = null;
		try {
			URL url = uri.toURL();
			URLConnection connection = url.openConnection();

			if (connection instanceof HttpURLConnection) {
				httpConnection = (HttpURLConnection) connection;

				httpConnection.setRequestMethod(method);
//				httpConnection.setRequestProperty("Content-Language", "en-US");

				httpConnection.setRequestProperty(apiAuthHeaderKey, getApitraryApi().getApiKey());
				httpConnection.setRequestProperty("Accept", contentType);
				httpConnection.setRequestProperty("Content-Type", contentType);

				httpConnection.setUseCaches(false);
				httpConnection.setDoInput(true);
				httpConnection.setDoOutput(payload!=null);

				log.debug(method+" "+ httpConnection.getURL()+(payload!=null?"application/json: "+payload:""));
				
				if(payload!=null){
					byte[] bytes = payload.getBytes();
					httpConnection.setRequestProperty("Content-Length", "" + Integer.toString(bytes.length));
					DataOutputStream wr = new DataOutputStream(connection.getOutputStream());
					wr.writeBytes(payload);
					wr.flush();
					wr.close();
				}

				return new JavaNetClientTransportResult(httpConnection);
			} else {
				throw new ApiTransportException("Connection is not an HTTPConnection");
			}
		} catch (IOException ioe) {
			throw new ApiTransportException(ioe);
		}
	}
1112604
def execute(self, payload, *args, flavour: ModuleType, **kwargs):
        
        if args or kwargs:
            payload = functools.partial(payload, *args, **kwargs)
        return self._meta_runner.run_payload(payload, flavour=flavour)
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);
    }
128915
function(method, payload, callback) {
			var that = this,
				request = new XMLHttpRequest();
			var xtarget = gui.URL.external(this._url, document);
			if (xtarget && window.XDomainRequest) {
				request = new window.XDomainRequest(); // @TODO: test this thing!
			}
			request.onreadystatechange = function() {
				if (this.readyState === XMLHttpRequest.DONE) {
					var data = that._response(this.responseText);
					callback(this.status, data, this.responseText);
				}
			};
			if (this._override) {
				request.overrideMimeType(this._headers.Accept);
			}
			request.open(method.toUpperCase(), this._url, true);
			if (!xtarget) { // headers not used xdomain per spec
				gui.Object.each(this._headers, function(name, value) {
					request.setRequestHeader(name, value, false);
				});
			}
			request.send(payload);
		}
627606
function PartiallyAppliedMessage(underlyingMessage, payload) {

  function message(...otherPayloads) {
    return underlyingMessage.apply(null, [payload, ...otherPayloads])
  }

  message.type = 'partiallyAppliedMessage'

  message._id = underlyingMessage._id
  message._name = underlyingMessage._name
  message._isMessage = true

  message.with = withPayload

  // Used for VDOM Diffing (See util/shallowEqual)
  message.payload = payload

  return message
}