Authored by qinchao

fix

... ... @@ -18,8 +18,11 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.ParameterizedTypeReference;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpMethod;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service;
import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;
import org.springframework.web.client.RestTemplate;
import java.util.List;
... ... @@ -60,7 +63,10 @@ public class OcrCertPhotoService {
//respVo=restTemplate.postForObject(url, req, Response.class);
ParameterizedTypeReference<Response<ImageReviewResp>> typeRef = new ParameterizedTypeReference<Response<ImageReviewResp>>() {};
HttpEntity httpEntity = new HttpEntity(req);
MultiValueMap<String, String> headers = new LinkedMultiValueMap();
headers.set("Content-Type", "application/json; charset=UTF-8");
headers.set("Accept", MediaType.APPLICATION_JSON_VALUE);
HttpEntity httpEntity = new HttpEntity(req,headers);
ResponseEntity<Response<ImageReviewResp>> responseEntity = restTemplate.exchange(url, HttpMethod.POST,httpEntity, typeRef);
respVo = responseEntity.getBody();
... ...