Guest User

Untitled

a guest
Feb 14th, 2018
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.04 KB | None | 0 0
  1. private static Scanner input = new Scanner(new InputStreamReader(socket.getInputStream()));
  2.  
  3. private static void getAnswer() throws IOException {
  4. System.out.println("<server> getting answer");
  5. while (input.hasNextLine()) {
  6. String line = input.nextLine();
  7. System.out.println(line);
  8. request.add(line);
  9. if (line == null || line.length() == 0) {
  10. break;
  11. }
  12. }
  13. System.out.println("exit");
  14. }
  15.  
  16. <server> getting answer
  17. POST /forms/formPOST.html HTTP/1.1
  18. Host: localhost
  19. Connection: keep-alive
  20. Content-Length: 113
  21. Cache-Control: max-age=0
  22. Origin: http://localhost
  23. Upgrade-Insecure-Requests: 1
  24. Content-Type: application/x-www-form-urlencoded
  25. User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.140 Safari/537.36
  26. Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
  27. Referer: http://localhost/forms/formPOST.html
  28. Accept-Encoding: gzip, deflate, br
  29. Accept-Language: ru-RU,ru;q=0.9,en-US;q=0.8,en;q=0.7
Add Comment
Please, Sign In to add comment