Returns `Accept` based on an array of accepts provided. :param accepts: List of headers. :return: Accept (e.g. application/json).
(self, accepts)
| 506 | return params |
| 507 | |
| 508 | def select_header_accept(self, accepts): |
| 509 | """Returns `Accept` based on an array of accepts provided. |
| 510 | |
| 511 | :param accepts: List of headers. |
| 512 | :return: Accept (e.g. application/json). |
| 513 | """ |
| 514 | if not accepts: |
| 515 | return |
| 516 | |
| 517 | accepts = [x.lower() for x in accepts] |
| 518 | |
| 519 | if 'application/json' in accepts: |
| 520 | return 'application/json' |
| 521 | else: |
| 522 | return ', '.join(accepts) |
| 523 | |
| 524 | def select_header_content_type(self, content_types, method=None, body=None): |
| 525 | """Returns `Content-Type` based on an array of content_types provided. |
no outgoing calls
no test coverage detected