Page 2 of 2 FirstFirst 12
Results 21 to 23 of 23
  1. #21
    Lil_Aziz1's Avatar
    Lil_Aziz1 is offline Senior Member
    Join Date
    Dec 2009
    United States
    Rep Power


    Oh. Thought the URLConnection does that for you, like make sure all the default headers are set for you.

    After doing
    Java Code:
    		GConnection.setRequestProperty("User-Agent", "Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0; H010818)");
    		Map<String, List<String>> properties = GConnection.getRequestProperties();
    		for (String s : properties.keySet())
    			System.out.printf("%s: %s%n", s, properties.get(s));
    I realize that no headers are set for you. :\

    I was wondering, is this how you would send cookies too?
    "Experience is what you get when you don't get what you want" (Dan Stanford)
    "Rise and rise again until lambs become lions" (Robin Hood)

  2. #22
    Sno's Avatar
    Sno is offline Senior Member
    Join Date
    Apr 2010
    Rep Power


    I dont know anything about java and cookies, but I do know about Javascript and cookies.

    Here is the API on java cookie
    :rolleyes: ~ Sno ~ :rolleyes:
    '-~ B.S. Computer Science ~-'

  3. #23
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Eastern Florida
    Rep Power


    I believe the method: setRequestProperty
    can set some request header fields.

Page 2 of 2 FirstFirst 12

Similar Threads

  1. An Efficiency Question
    By Revenna in forum Java 2D
    Replies: 0
    Last Post: 06-25-2010, 08:22 AM
  2. URLConnection not timing out as expected
    By StephenS in forum Networking
    Replies: 2
    Last Post: 04-02-2010, 04:10 AM
  3. How to set request parameters to an URLConnection
    By somesh A in forum Networking
    Replies: 0
    Last Post: 04-10-2009, 09:08 AM
  4. method efficiency
    By TheWave in forum Advanced Java
    Replies: 0
    Last Post: 02-13-2008, 05:11 AM
  5. Opening URLConnection
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 11-24-2007, 08:37 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts