adds data to the request, returns true if request is complete
340000
def completed?(str)
    str, @prelude = @prelude + str, "" unless @prelude.empty?
    add_lines(str)
    return unless @state == :body && @body.bytesize >= @content_length
    @prelude = bslice(@body, @content_length..-1)
    @body = bslice(@body, 0..@content_length)
    @state = :init
  end
1133947
private void addPostParams(final Request request) {
        if (code != null) {
            request.addPostParam("Code", code);
        }

        if (to != null) {
            request.addPostParam("To", to);
        }
    }
627517
private void addPostParams(final Request request) {
        if (enabled != null) {
            request.addPostParam("Enabled", enabled.toString());
        }

        if (webhookUrl != null) {
            request.addPostParam("WebhookUrl", webhookUrl.toString());
        }

        if (webhookMethod != null) {
            request.addPostParam("WebhookMethod", webhookMethod);
        }
    }
1149008
def addRequest(self, service, *args):
        
        wrapper = RequestWrapper(self, '/%d' % self.request_number,
            service, *args)

        self.request_number += 1
        self.requests.append(wrapper)

        if self.logger:
            self.logger.debug('Adding request %s%r', wrapper.service, args)

        return wrapper
1263085
private void addPostParams(final Request request) {
        if (data != null) {
            request.addPostParam("Data", Converter.mapToJson(data));
        }
    }
970283
def update(self):
        '''
        
        '''
        conditionalRequestHeader = dict()
        if self.etag is not None:
            conditionalRequestHeader[Consts.REQ_IF_NONE_MATCH] = self.etag
        if self.last_modified is not None:
            conditionalRequestHeader[Consts.REQ_IF_MODIFIED_SINCE] = self.last_modified

        status, responseHeaders, output = self._requester.requestJson(
            "GET",
            self._url.value,
            headers=conditionalRequestHeader
        )
        if status == 304:
            return False
        else:
            headers, data = self._requester._Requester__check(status, responseHeaders, output)
            self._storeAndUseAttributes(headers, data)
            self.__completed = True
            return True
342144
def data(self, *args):
        ''''''
        data = self._data
        if not args:
            return data or {}
        result, adding = self._attrdata('data', *args)
        if adding:
            if data is None:
                self._extra['data'] = {}
            add = self._visitor.add_data
            for key, value in result.items():
                add(self, key, value)
            return self
        else:
            return result
78904
public synchronized boolean complete(Response result) {
        if (completed) {
            return false;
        }
        completed = true;
        this.result = result;
        notifyAll();
        return true;
    }
1150408
def add(self, req: Request):
        
        key = req.key
        if key not in self:
            self[key] = ReqState(req)
        return self[key]
1112918
protected CompletableFuture<AppendResponse> handleAppend(final AppendRequest request) {
    CompletableFuture<AppendResponse> future = new CompletableFuture<>();

    // Check that the term of the given request matches the local term or update the term.
    if (!checkTerm(request, future)) {
      return future;
    }

    // Check that the previous index/term matches the local log's last entry.
    if (!checkPreviousEntry(request, future)) {
      return future;
    }

    // Append the entries to the log.
    appendEntries(request, future);
    return future;
  }
751641
def post_result_data(self, client, check, output, status):
        
        data = {
            'source': client,
            'name': check,
            'output': output,
            'status': status,
        }
        self._request('POST', '/results', data=json.dumps(data))
        return True
315324
protected function updateValuesFromRequest()
    {
        $data = $this->getRequest()->isPost()
            ? $this->getRequest()->getPost()
            : $this->getRequest()->getQuery();
        if (isset($_FILES)) {
            $data = array_merge($data, $this->request->getUploadedFiles());
        }
        $this->setValues($data);

    }
658621
private void addPostParams(final Request request) {
        if (attributes != null) {
            request.addPostParam("Attributes", attributes);
        }

        if (dateCreated != null) {
            request.addPostParam("DateCreated", dateCreated.toString());
        }

        if (dateUpdated != null) {
            request.addPostParam("DateUpdated", dateUpdated.toString());
        }
    }
699911
private void addPostParams(final Request request) {
        if (statusCallback != null) {
            request.addPostParam("StatusCallback", statusCallback.toString());
        }

        if (uniqueName != null) {
            request.addPostParam("UniqueName", uniqueName);
        }
    }
347987
def add_request(self, request):
        

        # Duplicate request name?
        if request.name in self.requests:
            raise ValueError('redefinition of request "{0}"'.format(request.name))
        self.requests[request.name] = request

        # Add the request URLs
        for method, url in request.urls:

            # URL with arguments?
            if RE_URL_ARG.search(url):
                request_regex = '^' + RE_URL_ARG_ESC.sub(r'/(?P<\1>[^/]+)', re.escape(url)) + '$'
                self.__request_regex.append((method, re.compile(request_regex), request))
            else:
                request_key = (method, url)
                if request_key in self.__request_urls:
                    raise ValueError('redefinition of request URL "{0}"'.format(url))
                self.__request_urls[request_key] = request
1216802
public boolean send()
	{
		assert sentRequests == null;
		sentRequests = new ArrayList<RequestCallInfo>();

		// add prepended requests,
		addPrependedRequests( sentRequests );

		// add requests to send
		while( !requestsToSend.isEmpty() )
			sentRequests.add( requestsToSend.remove( 0 ) );

		// add appended requests
		addAppendedRequests( sentRequests );

		// prepare payload
		JSONArray payload = createPayload();

		RequestBuilder builderPost = buildMultipart( "payload", payload.toString() );

		nbSentBytes += builderPost.getRequestData().length();

		try
		{
			sentRequest = builderPost.send();
		}
		catch( RequestException e )
		{
			callback.error( RPCErrorCodes.ERROR_REQUEST_SEND, e, this );
			return false;
		}

		callback.sent( this );

		return true;
	}
795706
def append(self, path, data, **kwargs):
        
        metadata_response = self._post(
            path, 'APPEND', expected_status=httplib.TEMPORARY_REDIRECT, **kwargs)
        data_response = self._requests_session.post(
            metadata_response.headers['location'], data=data, **self._requests_kwargs)
        _check_response(data_response)
        assert not data_response.content