def _insert_or_merge_entity(entity):
_validate_entity(entity)<EOL>request = HTTPRequest()<EOL>request.method = '<STR_LIT>'<EOL>request.headers = [_DEFAULT_CONTENT_TYPE_HEADER,<EOL>_DEFAULT_ACCEPT_HEADER]<EOL>request.body = _get_request_body(_convert_entity_to_json(entity))<EOL>return request<EOL>
Constructs an insert or merge entity request.