Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.io.BufferedReader;
- import java.io.DataOutputStream;
- import java.io.InputStreamReader;
- import java.net.HttpURLConnection;
- import java.net.URL;
- import javax.net.ssl.HttpsURLConnection;
- try {
- String webarg = "http://192.168.2.5/WebQueuePro/index.php/tickets/addticket/";
- webarg = webarg + "?headless=1&queue=TRACK";
- for(int i= 0; i < ticket.getLinesCount(); i++){
- line = ticket.getLine(i);
- if (line.isProductKitchen()){
- webarg = webarg + "&contents[]=" + line.printMultiply() + " +X+ " + URLEncoder.encode(line.printName());
- }
- }
- URL obj = new URL(webarg);
- HttpURLConnection con = (HttpURLConnection) obj.openConnection();
- // optional default is GET
- con.setRequestMethod("GET");
- //add request header
- con.setRequestProperty("User-Agent", USER_AGENT);
- int responseCode = con.getResponseCode();
- BufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream()));
- String inputLine;
- StringBuffer response = new StringBuffer();
- while ((inputLine = in.readLine()) != null) {
- response.append(inputLine);
- }
- in.close();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement