Mercurial Hosting > luan
comparison src/luan/modules/url/LuanUrl.java @ 1364:45363886f256
add url methods
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Wed, 29 May 2019 19:03:25 -0600 |
parents | 1a7b8e38921a |
children | eb8b35dccd99 |
comparison
equal
deleted
inserted
replaced
1363:1a7b8e38921a | 1364:45363886f256 |
---|---|
37 private byte[] content = NO_CONTENT; | 37 private byte[] content = NO_CONTENT; |
38 private MultipartClient multipart = null; | 38 private MultipartClient multipart = null; |
39 private int timeout = 0; | 39 private int timeout = 0; |
40 private String authUsername = null; | 40 private String authUsername = null; |
41 private String authPassword = null; | 41 private String authPassword = null; |
42 public HttpURLConnection httpCon; | |
42 | 43 |
43 public LuanUrl(URL url,LuanTable options) throws LuanException { | 44 public LuanUrl(URL url,LuanTable options) throws LuanException { |
44 if( options != null ) { | 45 if( options != null ) { |
45 Map map = options.asMap(); | 46 Map map = options.asMap(); |
46 String methodStr = getString(map,"method"); | 47 String methodStr = getString(map,"method"); |
247 if( method!=Method.GET ) | 248 if( method!=Method.GET ) |
248 throw new LuanException("method must be GET but is "+method); | 249 throw new LuanException("method must be GET but is "+method); |
249 return con.getInputStream(); | 250 return con.getInputStream(); |
250 } | 251 } |
251 | 252 |
252 HttpURLConnection httpCon = (HttpURLConnection)con; | 253 httpCon = (HttpURLConnection)con; |
253 | 254 |
254 if( method==Method.GET ) { | 255 if( method==Method.GET ) { |
255 return getInputStream(httpCon,authorization); | 256 return getInputStream(httpCon,authorization); |
256 } | 257 } |
257 | 258 |