Set body type of requests and responses.

@param string $type Type of the REST body
777387
protected function setRestBodyType($type)
    {
        $type = strtolower($type);
        switch ($type) {
            case 'json':
            case 'xml':
                $this->restBodyType = $type;
                break;

            default:
                throw new \Exception("REST body type '$type' not suported");
        }
    }
1097424
protected function setType(string $type) : void
    {
        if (empty($type)) {
            throw new InvalidArgumentException(__CLASS__ . ': Empty field type is not allowed');
        }

        if (! in_array($type, array_keys($this->defaultOptions))) {
            throw new InvalidArgumentException(__CLASS__ . ': Unsupported field type: ' . $type);
        }

        $this->type = $type;
    }
1299538
public function setBodyType($type)
    {
        if ($type == 'html' || $type == 'text' || $type = 'both') {
            $this->body_type = $type;
        } else {
            throw new Exception_TMail("Unsupported body type: $type");
        }

        return $this;
    }
279143
public function setPostType($type)
    {
        if (!in_array($type, [0, 1, 2, 3, 4, 5])) {
            $this->postType = self::POST_FORM_DATA;
        } else {
            $this->postType = $type;
        }
        return $this;
    }
244265
public function setType($type)
    {
        if ($this->formHelper->getFieldType($type)) {
            $this->type = $type;
        }

        return $this;
    }
579708
public function setShippingType($type)
    {
        $param = $type;
        if ($this->shipping == null) {
            $this->shipping = new PagSeguroShipping();
        }
        if ($param instanceof PagSeguroShippingType) {
            $this->shipping->setType($param);
        } else {
            $this->shipping->setType(new PagSeguroShippingType($param));
        }
    }
925969
public function setBody($body)
    {
        $this->guzzleRequest = $this->guzzleRequest->withBody(\GuzzleHttp\Psr7\stream_for($body));
    }
1184425
public function setType($type = 'string')
    {
        if (!\in_array($type, $this->validTypes, true)) {
            throw new InvalidQueryParameterTypeException($type, $this->validTypes);
        }

        $this->type = $type;
    }
824799
public function setLogType($type)
    {
        if (empty($type)) {
            $type = 'log';
        }

        $this->log_type = $type;
        $this->function = 'console.' . $this->log_type;
    }
945160
public function setType($type)
    {
        if (gettype($type) === 'string') {
            $this->type = $type;
        } else {
            $msg = "Type must be a string, '" . gettype($type) . "' given.";
            throw new InvalidArgumentException($msg);
        }
    }
754305
protected function setFormDataRequestServicesCheckout($type)
    {
        $this->data_form["request_{$type}_methods"] = false;

        if (!empty($this->data_form["get_{$type}_methods"])
            || (!empty($this->data_form['order'][$type]) && !empty($this->data_form["has_dynamic_{$type}_methods"]))) {
            $this->data_form["show_{$type}_methods"] = true;
            $this->data_form["request_{$type}_methods"] = true;
        }
    }
29810
public function setByType($type)
    {
        if (isset(self::$sourceList[$type])) {
            $this->value = self::$sourceList[$type];
        } else {
            throw new Exception("undefined index $type");
        }
    }
303035
public function setRealType($type) {
	    if (empty($type)) {
	        return;
        }
        foreach ($this->allowTypes as $key => $item) {
	        if ((!is_array($item) && $item == $type)
                || (is_array($item) && in_array($type, $item))) {
	            $this->realType = $type;
	            return;
            }
        }
	}
1147266
public function setType($type)
    {
        if (in_array($type, array_keys($this->devices))) {
            $this->type = $type;
        }
    }
894310
public function setType($type = '')
    {
        $this->type = empty($type) ? RouteType::NORMAL : $type;
        return true;
    }
1267390
public function setBody( $body, $contentType = null, $charset = null )
	{
		$this->swift->setBody( $body, $contentType, $charset );
	}
837917
public function setByType($type)
    {
        if (isset(self::$statusList[$type])) {
            $this->value = self::$statusList[$type];
        } else {
            throw new Exception("undefined index $type");
        }
    }