Updates The resource data and header options
513631
def _update_request(self, data, options):
        
        data = json.dumps(data)

        if 'headers' not in options:
            options['headers'] = {}

        options['headers'].update({'Content-type': 'application/json'})

        return data, options
703915
def update_all(self, rs=None, since=None):
        ""
        self._log.info("Updating resources: %s", ' '.join(r.tag for r in rs))

        if rs is None:
            rs = resource.all_resources()
        ctx = self._ContextClass(self)
        for r in rs:
            self._atomic_update(lambda: ctx.sync_resource(r, since=since))
739706
def UpdateProtoResources(self, status):
    """"""
    user_cpu = status.cpu_time_used.user_cpu_time
    system_cpu = status.cpu_time_used.system_cpu_time
    self.context.client_resources.cpu_usage.user_cpu_time += user_cpu
    self.context.client_resources.cpu_usage.system_cpu_time += system_cpu

    user_cpu_total = self.context.client_resources.cpu_usage.user_cpu_time
    system_cpu_total = self.context.client_resources.cpu_usage.system_cpu_time

    self.context.network_bytes_sent += status.network_bytes_sent

    if self.runner_args.cpu_limit:
      if self.runner_args.cpu_limit < (user_cpu_total + system_cpu_total):
        # We have exceeded our limit, stop this flow.
        raise FlowRunnerError("CPU limit exceeded.")

    if self.runner_args.network_bytes_limit:
      if (self.runner_args.network_bytes_limit <
          self.context.network_bytes_sent):
        # We have exceeded our byte limit, stop this flow.
        raise FlowRunnerError("Network bytes limit exceeded.")
884799
def _update_response_location_header(self, resource):
        
        location = resource_to_url(resource, request=self.request)
        loc_hdr = ('Location', location)
        hdr_names = [hdr[0].upper() for hdr in self.request.response.headerlist]
        try:
            idx = hdr_names.index('LOCATION')
        except ValueError:
            self.request.response.headerlist.append(loc_hdr)
        else:
            # Replace existing location header.
            # FIXME: It is not clear under which conditions this happens, so
            #        we do not have a test for it yet.
            self.request.response.headerlist[idx] = loc_hdr
780298
def update(self, name, html_url, zip_url):
        """"""
        body = {
            "Name": name,
            "HtmlPageURL": html_url,
            "ZipFileURL": zip_url}
        response = self._put("/templates/%s.json" %
                             self.template_id, json.dumps(body))
423706
public function UpdateHeaders () {
		$rawHeaders = headers_list();
		$name = '';
		$value = '';
		foreach ($rawHeaders as $rawHeader) {
			$doubleDotPos = strpos($rawHeader, ':');
			if ($doubleDotPos !== FALSE) {
				$name = trim(substr($rawHeader, 0, $doubleDotPos));
				$value = trim(substr($rawHeader, $doubleDotPos + 1));
			} else {
				$name = $rawHeader;
				$value = '';
			}
			if (!isset($this->disabledHeaders[$name]))
  				$this->headers[$name] = $value;
		}
	}
1283467
protected void updateFromResource() {

        setCreationDate(m_resource.getDateCreated());
        int length = m_resource.getLength();
        if (m_resource.isFolder()) {
            length = 1;
        }
        setFileSize(length);
        setModifyDate(m_resource.getDateLastModified());
        setAttributes(m_resource.isFile() ? FileAttribute.Normal : FileAttribute.Directory);
    }
38046
def update_object(self, url, container, container_object, object_headers,
                      container_headers):
        

        headers, container_uri = self._return_base_data(
            url=url,
            container=container,
            container_object=container_object,
            container_headers=container_headers,
            object_headers=object_headers,
        )

        return self._header_poster(
            uri=container_uri,
            headers=headers
        )
451697
private void updateHeader() {
        gradientPanel.setBackground(getHeaderBackground());
        gradientPanel.setOpaque(isSelected());
        titleLabel.setForeground(getTextForeground(isSelected()));
        headerPanel.repaint();
    }
249081
def update_resource_entry(self, bundleId, languageId, resourceKey, data=None):
        """"""
        headers={'content-type':'application/json'}
        url = self.__get_base_bundle_url() + "/" + bundleId + "/" + languageId + "/" + resourceKey
        json_data = {}
        if not data is None:
            json_data = json.dumps(data)
        response = self.__perform_rest_call(requestURL=url, restType='POST', body=json_data, headers=headers)
        return response
1291522
protected void addLinkAndOptionsHttpHeaders(final FedoraResource resource) {
        // Add Link headers
        addResourceLinkHeaders(resource);
        addAcceptExternalHeader();

        // Add Options headers
        final String options;
        if (resource.isMemento()) {
            options = "GET,HEAD,OPTIONS,DELETE";
        } else if (resource instanceof FedoraTimeMap) {
            options = "POST,HEAD,GET,OPTIONS";
            servletResponse.addHeader("Vary-Post", MEMENTO_DATETIME_HEADER);
            addAcceptPostHeader();
        } else if (resource instanceof FedoraBinary) {
            options = "DELETE,HEAD,GET,PUT,OPTIONS";
        } else if (resource instanceof NonRdfSourceDescription) {
            options = "HEAD,GET,DELETE,PUT,PATCH,OPTIONS";
            servletResponse.addHeader(HTTP_HEADER_ACCEPT_PATCH, contentTypeSPARQLUpdate);
        } else if (resource instanceof Container) {
            options = "MOVE,COPY,DELETE,POST,HEAD,GET,PUT,PATCH,OPTIONS";
            servletResponse.addHeader(HTTP_HEADER_ACCEPT_PATCH, contentTypeSPARQLUpdate);
            addAcceptPostHeader();
        } else {
            options = "";
        }

        servletResponse.addHeader("Allow", options);
    }
298838
def update_options(self, **options):
        """"""

        _check_options(options)

        if 'persistence_engine' in options:
            options['persistence_engine'] = reference_to_path(
                options['persistence_engine'])

        if 'id' in options:
            self._id = options['id']

        self._options.update(options)
497840
def update(customer, **data):
        
        if isinstance(customer, resources.Customer):
            customer = customer.id

        http_client = HttpClient()
        response, _ = http_client.patch(routes.url(routes.CUSTOMER_RESOURCE, resource_id=customer), data)
        return resources.Customer(**response)
555176
def refresh(header = self.class::DEFAULT_REQUEST_HEADER)
      ensure_client && ensure_uri
      response = @client.rest_get(@data['uri'], header, @api_version)
      body = @client.response_handler(response)
      set_all(body)
      self
    end
1215128
function update(name, config, cb) {
  this.remoteAccessApi.postViewConfig(name, config, this.opts.headers, cb);
}
324371
protected function updateHostHeaderFromUri()
    {
        if ($host = $this->uri->getHost()) {
            if (($port = $this->uri->getPort()) !== null) {
                $host .= ':' . $port;
            }

            $this->headers->set('Host', $host);
        }
    }
806295
def update_admin_object_resource(name, server=None, **kwargs):
    '''
    
    '''
    if 'jndiName' in kwargs:
        del kwargs['jndiName']
    return _update_element(name, 'resources/admin-object-resource', kwargs, server)