store request in malloc buffer