Skip to content

Commit

Permalink
Set http headers
Browse files Browse the repository at this point in the history
  • Loading branch information
Konstantin Bogomolov committed Jun 5, 2021
1 parent fc49d76 commit c1c226e
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ private String makeRequest(String urlString, String text) {
urlConnection = (HttpURLConnection) url.openConnection();
urlConnection.setDoOutput(true);
urlConnection.setChunkedStreamingMode(0);
urlConnection.setRequestProperty("Content-Type", "application/json; charset=utf-8");
urlConnection.setRequestProperty("User-agent", "SMS Forwarder App");

OutputStream out = new BufferedOutputStream(urlConnection.getOutputStream());
BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(out, StandardCharsets.UTF_8));
Expand Down

0 comments on commit c1c226e

Please sign in to comment.