Fix handling of empty responses in RestClient