Soup.MessageHeadersIter

Fields

Name

Type

Access

Description

dummy

[object]

r

Methods

class

init (hdrs)

next ()

Details

class Soup.MessageHeadersIter

An opaque type used to iterate over a Soup.MessageHeaders structure.

After intializing the iterator with Soup.MessageHeadersIter.init(), call Soup.MessageHeadersIter.next() to fetch data from it.

You may not modify the headers while iterating over them.

classmethod init(hdrs)
Parameters:

hdrs (Soup.MessageHeaders) – a Soup.MessageHeaders

Returns:

a pointer to a Soup.MessageHeadersIter structure

Return type:

iter: Soup.MessageHeadersIter

Initializes iter for iterating hdrs.

next()
Returns:

True if another name and value were returned, False if the end of the headers has been reached.

name:

pointer to a variable to return the header name in

value:

pointer to a variable to return the header value in

Return type:

(bool, name: str, value: str)

Yields the next name/value pair in the Soup.MessageHeaders being iterated by self. If self has already yielded the last header, then Soup.MessageHeadersIter.next() will return False and name and value will be unchanged.