package app.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Service;
import org.springframework.web.client.RestTemplate;

/**
 *
 * @author Tim
 */
@Service
public class PhpPageService {

    @Bean
    public RestTemplate restTemplate() {
        return new RestTemplate();
    }
 
    public String fetchAndParsePhpPage(String url) {
        String phpResult = restTemplate().getForObject(url, String.class);
        return "PhpPageService: Result:<br />" + phpResult;
    }
}