Sets the content of the request.
325378
def set_content(self, value: RequestContent, *,
                    content_type: str = None):
        '''
        
        '''
        assert self._attached_files is None, \
               'cannot set content because you already attached files.'
        guessed_content_type = 'application/octet-stream'
        if value is None:
            guessed_content_type = 'text/plain'
            self._content = b''
        elif isinstance(value, str):
            guessed_content_type = 'text/plain'
            self._content = value.encode('utf-8')
        else:
            guessed_content_type = 'application/octet-stream'
            self._content = value
        self.content_type = (content_type if content_type is not None
                             else guessed_content_type)
1344257
public function setContent(\AgentSIB\Diadoc\Api\Proto\Content_v2 $value = null)
    {
        $this->Content = $value;
    }
1293401
public void setContent(Widget content) {

        if (m_content != null) {
            m_content.removeFromParent();
        }
        if (m_isFrame) {
            m_contentPanel.setWidget(content);
        } else {
            m_popup.setMainContent(content);
        }
        m_content = content;
    }
1267642
public Request setContent(String text, ContentType contentType) {
        entity = new StringEntity(text, contentType);
        return this;
    }
1332931
public void setContent(final WComponent content) {
		getOrCreateComponentModel().content = content;

		// There should only be one content.
		holder.removeAll();
		holder.add(content);
	}
140832
public void setContent(Region content) {
        if (content != null) {
            this.content = content;
            this.content.setPickOnBounds(false);
            contentHolder.getChildren().setAll(content);
        }
    }
1316291
public RequestFuture<T> setRequest(Request<T> request) {
        this.request = request;
        this.request.addErrorListener(this);
        this.request.addResponseListener(this);
        return this;
    }
790842
protected void setContentEnd(String contentEnd) {
        if (contentEnd == null) {
            contentEnd = StringUtils.EMPTY;
        }
        this.contentEnd = contentEnd;
    }
631555
public void setContent(IContent content)
	{
		this.content = content;
		content.setParent(this);
		content.setPosition(Position.middleCenter(content).plus(offsetPosition));
	}
1343630
def set_content(self, data):
        
        content = self._get_content(data, 'content')

        if content == '':
            content = self._get_content(data, 'summary_detail')

        if content == '':
            if data.get('description'):
                content = data.get('description')

        return content
1247286
public final void setContent(ContentPart<?>[] content)
    {
        //clear non relevant flags
        this.contentString=null;
        this.contentBinary=null;
        this.contentType=ContentType.MULTI_PART;

        if(content==null)
        {
            this.contentParts=null;
        }
        else
        {
            this.contentParts=content.clone();
        }
    }
92736
@Override
    public void setContent(final InputStream content, final String contentType,
                           final Collection<URI> checksums, final String originalFileName,
                           final StoragePolicyDecisionPoint storagePolicyDecisionPoint)
            throws UnsupportedOperationException {
        throw new UnsupportedOperationException(
                "Cannot call setContent() on local file, call setExternalContent() instead");
    }
561490
public function setContentClass()
    {
        $delivery = $this->getCurrentInstance();
        $contentClass = $this->getClass($this->getRequestParameter('model'));

        if (is_null($this->getClassService()->getContent($delivery))) {
            $content = $this->getClassService()->createContent($delivery, $contentClass);
            $success = true;
        } else {
            $this->logWarning('Content already defined, cannot be replaced');
            $success = false;
        }
        $this->returnJson(array(
            'success' => $success
        ));
    }
440769
def init_contents(self, size=0, **kwargs):
        """"""
        self.set_uri(
            *self.storage(**kwargs).initialize(size=size),
            readable=False, writable=True)
1330027
public void setContent(final WComponent content) {
		WindowModel model = getOrCreateComponentModel();

		// If the previous content had been wrapped, then remove it from the wrapping WApplication.
		if (model.wrappedContent != null && model.wrappedContent != model.content) {
			model.wrappedContent.removeAll();
		}

		model.content = content;

		// Wrap content in a WApplication
		if (content instanceof WApplication) {
			model.wrappedContent = (WApplication) content;
		} else {
			model.wrappedContent = new WApplication();
			model.wrappedContent.add(content);
		}

		// There should only be one content.
		holder.removeAll();
		holder.add(model.wrappedContent);
	}
7410
public static void setContentLength(HttpMessage message, long length) {
        message.headers().set(HttpHeaderNames.CONTENT_LENGTH, length);
    }
561870
def set_content_type (self):
        """"""
        self.content_type = mimeutil.guess_mimetype(self.url, read=self.get_content)