Mr.Z created HTTPCORE-760:
-----------------------------

             Summary: An error occurred in the HttpClient 4.5 Tutorial document
                 Key: HTTPCORE-760
                 URL: https://issues.apache.org/jira/browse/HTTPCORE-760
             Project: HttpComponents HttpCore
          Issue Type: Improvement
          Components: Documentation
    Affects Versions: 4.4.16
            Reporter: Mr.Z


Dear Apache HttpClient team,

I would like to report a bug in the documentation for Apache HttpClient. 
Specifically, I have found an error in the section on  _*1.1.3. Working with 
message headers.(link: 
[https://hc.apache.org/httpcomponents-client-4.5.x/current/tutorial/html/fundamentals.html]
 )

*_
{code:java}
HttpResponse response = new BasicHttpResponse(HttpVersion.HTTP_1_1, 
    HttpStatus.SC_OK, "OK");
response.addHeader("Set-Cookie", 
    "c1=a; path=/; domain=localhost");
response.addHeader("Set-Cookie", 
    "c2=b; path=\"/\", c3=c; domain=\"localhost\"");HeaderElementIterator it = 
new BasicHeaderElementIterator(
    response.headerIterator("Set-Cookie"));while (it.hasNext()) {
    HeaderElement elem = it.nextElement(); 
    System.out.println(elem.getName() + " = " + elem.getValue());
    NameValuePair[] params = elem.getParameters();
    for (int i = 0; i < params.length; i++) {
        System.out.println(" " + params[i]);
    }
} {code}
HttpClient 4.5 Tutorial  output result written in the document is:
{code:java}
c1 = a
path=/
domain=localhost
c2 = b
path=/
c3 = c
domain=localhost {code}
This is incorrect, the correct output should be:
{code:java}
c1 = a
 path=/
 domain=localhost
c2 = b
 path=/
c3 = c
 domain=localhost {code}
Could you please fix the format display? This may cause trouble for developers

 

Thank you for your attention to this matter.

Sincerely

 

 

 

_*

*_

 

 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
For additional commands, e-mail: dev-h...@hc.apache.org

Reply via email to