Skip to content

Commit

Permalink
Spesifiser encoding for StringEntity, da den er ISO_8859_1 hvis ikke …
Browse files Browse the repository at this point in the history
…annet spesifiseres
  • Loading branch information
johnksv committed Sep 1, 2021
1 parent 847dd90 commit ad6066a
Showing 1 changed file with 3 additions and 1 deletion.
Expand Up @@ -43,8 +43,10 @@

import java.io.IOException;
import java.net.URI;
import java.nio.charset.StandardCharsets;
import java.util.Optional;

import static java.nio.charset.StandardCharsets.UTF_8;
import static java.util.stream.Collectors.toList;
import static no.difi.sdp.client2.domain.exceptions.SendException.AntattSkyldig.fraHttpStatusCode;

Expand Down Expand Up @@ -104,7 +106,7 @@ private void createMessage(StandardBusinessDocument sbd) throws IOException {
LOG.debug("Generert følgende json, vil nå sende til integrasjonspunkt: {} ", json);

HttpPost httpPost = new HttpPost(endpointUri + CREATE_ENDPOINT_PATH);
httpPost.setEntity(new StringEntity(json));
httpPost.setEntity(new StringEntity(json, UTF_8));
httpPost.setHeader("content-type", "application/json");
CloseableHttpResponse response = httpClient.execute(httpPost);
String responseEntity = EntityUtils.toString(response.getEntity());
Expand Down

0 comments on commit ad6066a

Please sign in to comment.