Project

General

Profile

1
package eu.dnetlib.repo.manager.service.controllers;
2

    
3
import org.springframework.stereotype.Component;
4
import org.springframework.web.client.RestTemplate;
5

    
6
@Component
7
public class RestService {
8

    
9
    private static RestTemplate restTemplate = new org.springframework.web.client.RestTemplate();
10

    
11

    
12
    public static String executeGET(String uri){
13
        return  restTemplate.getForObject(uri,String.class);
14
    }
15

    
16
    public static String executePOST(String uri,String json){
17
        return  restTemplate.postForObject(uri,json,String.class);
18
    }
19
}
(9-9/11)