Discussions

News: TSS Article on HttpClient and FileUpload

  1. TSS Article on HttpClient and FileUpload (13 messages)

    The Jakarta Commons offer tools to help the everyday developer. In this article, Harshad Oak discusses the HttpClient and FileUpload components. He walks us through the usage of the two components via example.

    Read HttpClient and FileUpload

    Threaded Messages (13)

  2. Cool... but complicated, no?[ Go to top ]

    It is still a good step in the right direction.

    As an alternative, check out this: http://www.devx.com/Java/Article/17679/0
    Also, the server side of the game (together with the aforementioned client side) is published here: http://www.myjavatools.com/

    Thanks,
    Vlad
  3. I checked nogoop. It doesn't satisfy all my requirements. I need cookie and session management also in the libraries. Is there any package available?
    Ramana
  4. jCookie[ Go to top ]

    The HTTP protocol handler in TestMaker's TOOL library uses jCookie to handle cookies and maintain sessions. jCookie has worked well for my application. Details are at:

    http://jcookie.sourceforge.net/

    And the PushToTest Web site hosts jCookie's JavaDoc at:

    http://docs.pushtotest.com/jcookie/jCookie-0.8b/docs/api/

    Hope this helps.

    -Frank
  5. I checked nogoop. It doesn't satisfy all my requirements. I need cookie and session management also in the libraries. Is there any package available?Ramana
    I checked it too. I had the same problem with cookie and sessions. Then I try de CVS version and it's ok. Cookies and Sessions works very well.
  6. CVS version details[ Go to top ]

    Can you provide more details of the software you have tried.
  7. memory issue with commons file upload[ Go to top ]

    There is a memory issue with commons fileupload, it allocates way too much memory for each field in the request, you can see more about it here : http://www.jboss.org/wiki/Wiki.jsp?page=KnownBugs
  8. Vey Helpful[ Go to top ]

    The article is very helpful. Harshad Oak covers all the basic functions can be done using HTTPClient and File Upload Components.
  9. Http proxy error[ Go to top ]

    We have a proxy that requires username and password to access internet. I have trouble with the proxy. By following the direction in the article, here is the code,

            HttpClient client = new HttpClient();
            client.getHostConfiguration().setProxy(proxyhost, 80);
            client.getState().setProxyCredentials("Basic", proxyhost,
                   new UsernamePasswordCredentials(userID, password));

    Here is the response

    *** Request ***
    Request Path: /
    Request Query: null
    User-Agent: Jakarta Commons-HttpClient/2.0.1
    Host: www.yahoo.com
    Proxy-Connection: Keep-Alive
    *** Response ***
    Status Line: HTTP/1.1 407 Proxy Authentication Required
    Date: Tue, 10 Aug 2004 17:29:15 GMT
    Content-Length: 257
    Content-Type: text/html
    Server: NetCache appliance (NetApp/5.6)
    Proxy-Connection: close
    Proxy-Authenticate: Negotiate
    Proxy-Authenticate: NTLM
    Proxy-Authenticate: Basic realm="NETCACHE"

    *** Response Body ***
    <HTML>
    <HEAD><TITLE>407 Proxy Authentication Required</TITLE></HEAD>
    <BODY>
    <H1>Proxy Authentication Required</H1>
    <H4>
    Unable to complete request:<P>
    Access denied due to authentication failure.
    </H4>
    <HR>
    </BODY>
    </HTML>

    How do I get around this problem?

    Thanks!

    ct
  10. Http proxy error[ Go to top ]

    Dear c tang,

    The response header returned from proxy server NetApp/5.6 indicates that NLTM authentication scheme is used. so try this one:

    client.getState().setProxyCredentials("NTLM", proxyhost,
                   new NTCredentials(userName, password, host, domain));
  11. Http proxy error[ Go to top ]

    Dear Ali,

    I tried your suggestion before, it yielded the same result. I also tried to use NETCACHE and case variations of them. Nothing works!
  12. Http proxy error[ Go to top ]

    Try it with null realm i.e.

    client.getState().setProxyCredentials(null, proxyhost, new NTCredentials(userName, password, host, domain));
  13. Http proxy error[ Go to top ]

    Thanks, it works.

    In httpclient Authentication guide, it states "It is generally advised that while initially testing NTLM authentication, you pass the realm in as null which is used as the default." I intepret that a realm should be passed in real product system. However, I got a 407 error if a realm is passed as argument.
  14. Code does not work in Laptop[ Go to top ]

    Hi, I found this code very helpful. I have deployed this code in Desktop where it works fine, but when I am running on laptop then it sends the error saying connection refused (I am configuring the proxy server settings). My understanding is since it uses the HTTP post method and if laptop does not have the COM ports, it does not work. Is my understanding is correct? Please help me out to resolve this error. thanks