Mercurial Hosting > luan
comparison src/luan/modules/url/UrlCall.java @ 1165:668f29bc52ea
clean up content-type
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Wed, 07 Feb 2018 23:16:12 -0700 |
parents | 1a68fc55a80c |
children |
comparison
equal
deleted
inserted
replaced
1164:1f9d34a6f308 | 1165:668f29bc52ea |
---|---|
38 } | 38 } |
39 | 39 |
40 public String post(String content,String contentType) throws IOException { | 40 public String post(String content,String contentType) throws IOException { |
41 HttpURLConnection connection = (HttpURLConnection)this.connection; | 41 HttpURLConnection connection = (HttpURLConnection)this.connection; |
42 | 42 |
43 connection.setRequestProperty("Content-type",contentType); | 43 connection.setRequestProperty("content-type",contentType); |
44 connection.setDoOutput(true); | 44 connection.setDoOutput(true); |
45 connection.setRequestMethod("POST"); | 45 connection.setRequestMethod("POST"); |
46 | 46 |
47 byte[] post = content.getBytes(); | 47 byte[] post = content.getBytes(); |
48 connection.setRequestProperty("Content-Length",Integer.toString(post.length)); | 48 connection.setRequestProperty("Content-Length",Integer.toString(post.length)); |