Soup.MessageHeadersIter¶
Details¶
-
class
Soup.MessageHeadersIter¶ An opaque type used to iterate over a
Soup.MessageHeadersstructure.After intializing the iterator with
Soup.MessageHeadersIter.init(), callSoup.MessageHeadersIter.next() to fetch data from it.You may not modify the headers while iterating over them.
-
classmethod
init(hdrs)¶ Parameters: hdrs ( Soup.MessageHeaders) – aSoup.MessageHeadersReturns: a pointer to a Soup.MessageHeadersIterstructureReturn type: iter: Soup.MessageHeadersIterInitializes iter for iterating hdrs.
-
next()¶ Returns: Trueif another name and value were returned,Falseif 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.MessageHeadersbeing iterated by self. If self has already yielded the last header, thenSoup.MessageHeadersIter.next() will returnFalseand name and value will be unchanged.
-
classmethod