write to_request() and from_request()