def get_request_row_key(self, request):
if request.method == '<STR_LIT:POST>':<EOL><INDENT>doc = ETree.fromstring(request.body)<EOL>row_key = doc.find('<STR_LIT>', _etree_entity_feed_namespaces)<EOL>if row_key is None:<EOL><INDENT>raise AzureBatchValidationError(_ERROR_CANNOT_FIND_ROW_KEY)<EOL><DEDENT>return _get_etree_text(row_key)<EOL><DEDENT>else:<EOL><INDENT>uri = url_unquote(request.path)<EOL>pos1 = uri.find('<STR_LIT>')<EOL>pos2 = uri.find('<STR_LIT>', pos1)<EOL>if pos1 == -<NUM_LIT:1> or pos2 == -<NUM_LIT:1>:<EOL><INDENT>raise AzureBatchValidationError(_ERROR_CANNOT_FIND_ROW_KEY)<EOL><DEDENT>row_key = uri[pos1 + len('<STR_LIT>'):pos2]<EOL>return row_key<EOL><DEDENT>
Extracts RowKey from request.body if it is a POST request or from
request.path if it is not a POST request. Only insert operation request
is a POST request and the Rowkey is in the request body.

request:
    the request to insert, update or delete entity