You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by "Gerdes, Tom" <TG...@OldRepublicTitle.com> on 2006/11/28 19:49:35 UTC

Changing stringpart attributes

I am trying to use the example that shows how to use the RequestEntity.
I am trying to set my string parts to not send the "Content-Type",
"charset", or "Content-Transfer-Encoding" for my stringparts.  How do
set the individual parts before setting the RequestEntity.  

Below I have provided a snippet of my code.   I do appreciate gratefully
any help on this you can offer.

PostMethod post1 = new PostMethod("https://ecf.ksb.uscourts.gov/" +
theUrl);
post1.setRequestHeader("Accept", "image/gif, image/x-xbitmap,
image/jpeg, image/pjpeg, application/x-shockwave-flash,
application/vnd.ms-excel, application/vnd.ms-powerpoint,
application/msword, */*");
post1.setRequestHeader("Referer", HTTPS_SERVER);
post1.setRequestHeader("Accept-Language", "en-us");
post1.setRequestHeader("User-Agent", "Mozilla/4.0 (compatible; MSIE 6.0;
Windows NT 5.1; SV1; .NET CLR 1.1.4322)");
post1.setRequestHeader("Host", "ecf.ksb.uscourts.gov");
post1.setRequestHeader("Connection", "Keep-Alive");
Part[] parts = { new StringPart("login", Login),
                 new StringPart("key", Password),
                 new StringPart("clcode", "")
               };

for(int i=0; i<2; i++){ parts[i].setTransferEncoding(null);
                        parts[i].setContentType(null);
                        parts[i].setCharSet(null);
                      }

post1.setRequestEntity( new MultipartRequestEntity(parts,
post1.getParams()) );

I received a compile error as follows when I tried to compile this code.

BDKCWYAJ.java:122: cannot resolve symbol                            
symbol  : method setCharSet (<nulltype>)                            
location: class org.apache.commons.httpclient.methods.multipart.Part
                          parts[i].setCharSet(null);                


---------------------------------------------------------------------
To unsubscribe, e-mail: httpcomponents-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpcomponents-dev-help@jakarta.apache.org