Fix the 'Buy' operation.
[#742 state:resolved tagged:committed]
| 922 | 964 | |
|---|---|---|
| 77 | 77 | } |
| 78 | 78 | |
| 79 | 79 | huc.setRequestProperty("Content-Type", "application/x-www-form-urlencoded"); |
| 80 | huc.setRequestProperty("Content-Length", Integer.toString(cgiData.length()-1)); | |
| 80 | huc.setRequestProperty("Content-Length", Integer.toString(cgiData.length())); | |
| 81 | 81 | huc.setRequestProperty("User-Agent", Constants.FAKE_BROWSER); |
| 82 | 82 | if(referer != null) huc.setRequestProperty("Referer", referer); |
| 83 | 83 | if(cookie != null) { |
| 84 | 84 | huc.setRequestProperty("Cookie", cookie); |
| 85 | 85 | } |
| 86 | 86 | PrintStream obw = new PrintStream(huc.getOutputStream()); |
| 87 | obw.println(cgiData); | |
| 87 | obw.print(cgiData); | |
| 88 | 88 | obw.close(); |
| 89 | 89 | } catch(ConnectException ce) { |
| 90 | 90 | JConfig.log().logMessage("postFormPage: " + ce); |
| --- | --- | |
| 277 | 277 | } catch (MalformedURLException murle) { |
| 278 | 278 | JConfig.log().logMessage("Invalid URL!? (" + url + "): " + murle.getMessage()); |
| 279 | 279 | } catch (IOException ioe) { |
| 280 | try { result = StringTools.cat(huc.getErrorStream()); } catch (Exception e) { } | |
| 280 | try { if(huc != null) result = StringTools.cat(huc.getErrorStream()); } catch (Exception ignored) { } | |
| 281 | 281 | } |
| 282 | 282 | return result; |
| 283 | 283 | } |
