(prepared_request)
Move file pointer back to its recorded starting position
    so it can be read again on redirect.
Move file pointer back to its recorded starting position
    so it can be read again on redirect.
Move file pointer back to its recorded starting position so it can be read again on redirect .
def rewind_body(prepared_request):
    """Move file pointer back to its recorded starting position
    so it can be read again on redirect.
    """
    body_seek = getattr(prepared_request.body, 'seek', None)
    if body_seek is not None and isinstance(prepared_request._body_position, integer_types):
        try:
            body_seek(prepared_request._body_position)
        except (IOError, OSError):
            raise UnrewindableBodyError("An error occurred when rewinding request "
                                        "body for redirect.")
    else:
        raise UnrewindableBodyError("Unable to rewind request body for redirect.")
def rewind_body ( prepared_request ) : body_seek = getattr ( prepared_request . body , 'seek' , None ) if body_seek is not None and isinstance ( prepared_request . _body_position , integer_types ) : try : body_seek ( prepared_request . _body_position ) except ( IOError , OSError ) : raise UnrewindableBodyError ( "An error occurred when rewinding request " "body for redirect." ) else : raise UnrewindableBodyError ( "Unable to rewind request body for redirect." )