Camel.ContentType

Fields

Name

Type

Access

Description

params

object

r/w

refcount

int

r/w

subtype

str

r/w

type

str

r/w

Methods

class

decode (in_)

class

new (type, subtype)

dump ()

format ()

is_ (type, subtype)

param (name)

ref ()

set_param (name, value)

simple ()

unref ()

Details

class Camel.ContentType
classmethod decode(in_)
Parameters:

in (str) –

Return type:

Camel.ContentType

classmethod new(type, subtype)
Parameters:
  • type (str) – the major type of the new content-type

  • subtype (str) – the subtype

Returns:

the new Camel.ContentType

Return type:

Camel.ContentType

Create a new Camel.ContentType.

dump()
format()
Return type:

str

is_(type, subtype)
Parameters:
  • type (str) – A type to check against.

  • subtype (str) – A subtype to check against, or “*” to match any subtype.

Returns:

True if the content type ct is of type type/subtype or False otherwise

Return type:

bool

The subtype of “*” will match any subtype. If ct is None, then it will match the type “text/plain”.

param(name)
Parameters:

name (str) – name of param to find

Returns:

the value of the name param

Return type:

str

Searches the params on s Camel.ContentType for a param named name and gets the value.

ref()
Return type:

Camel.ContentType

Refs the content type.

set_param(name, value)
Parameters:
  • name (str) – name of param to set

  • value (str) – value of param to set

Set a parameter on self.

simple()
Return type:

str

unref()

Unrefs, and potentially frees, the content type.