Project

General

Profile

« Previous | Next » 

Revision 55064

Fixed ContentType JSON-UTF8 issue

View differences:

RepositoryServiceImpl.java
118 118
        LOGGER.debug("Updated version!");
119 119

  
120 120
        httpHeaders = new HttpHeaders();
121
        httpHeaders.set("Content-Type", "application/json");
121
        httpHeaders.setContentType(MediaType.APPLICATION_JSON_UTF8);
122
//        httpHeaders.set("Content-Type", "application/json");
122 123

  
123 124
        for (String vocName : vocabularyNames) {
124 125
            vocabularyMap.put(vocName, vocabularyLoader.getVocabulary(vocName, Locale.ENGLISH, Locale.ROOT));
......
411 412
            String json_repository = Converter.repositoryObjectToJson(repository);
412 413
            LOGGER.debug("JSON to add(update) -> " + json_repository);
413 414

  
415
//
416
//            // TODO delete these 3 lines
417
//            HttpHeaders temp = new HttpHeaders();
418
//            temp.setContentType(MediaType.APPLICATION_JSON_UTF8);
419

  
414 420
            HttpEntity<String> httpEntity = new HttpEntity<String>(json_repository, httpHeaders);
415 421
            ResponseEntity responseEntity = restTemplate.exchange(uriComponents.toUri(),HttpMethod.POST, httpEntity, ResponseEntity.class);
416 422

  
......
442 448
            LOGGER.debug("JSON to update -> " + json_repository);
443 449

  
444 450
            HttpEntity<String> httpEntity = new HttpEntity<String>(json_repository, httpHeaders);
445
            ResponseEntity responseEntity = restTemplate.exchange(uriComponents.toUri(),HttpMethod.POST, httpEntity, ResponseEntity.class);
451
            ResponseEntity responseEntity = restTemplate.exchange(uriComponents.toUri(),HttpMethod.POST, httpEntity
452
                    , ResponseEntity.class);
446 453

  
447 454
            if (responseEntity.getStatusCode().equals(HttpStatus.OK))
448 455
                emailUtils.sendUserUpdateRepositoryEmail(repository, authentication);

Also available in: Unified diff