Home > PHP > Function > > HttpRequest::setContentType()

HttpRequest::setContentType()

HttpRequest::setContentType - Set content type

Syntax

public HttpRequest::setContentType (string $content_type)

Arguments

  • content_type - the content type of the request (primary/secondary)

Description

Set the content type the post request should have.

Version

PHP PECL pecl_http >= 0.10.0

Return value

Returns TRUE on success, or FALSE if the content type does not seem to contain a primary and a secondary part.