Returns `Accept` based on an array of accepts provided. :param accepts: List of headers. :return: Accept (e.g. application/json).
(self, accepts: List[str])
| 534 | return params |
| 535 | |
| 536 | def select_header_accept(self, accepts: List[str]) -> Optional[str]: |
| 537 | """Returns `Accept` based on an array of accepts provided. |
| 538 | |
| 539 | :param accepts: List of headers. |
| 540 | :return: Accept (e.g. application/json). |
| 541 | """ |
| 542 | if not accepts: |
| 543 | return None |
| 544 | |
| 545 | for accept in accepts: |
| 546 | if re.search('json', accept, re.IGNORECASE): |
| 547 | return accept |
| 548 | |
| 549 | return accepts[0] |
| 550 | |
| 551 | def select_header_content_type(self, content_types): |
| 552 | """Returns `Content-Type` based on an array of content_types provided. |
no outgoing calls
no test coverage detected