473,394 Members | 1,697 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Set the Content-Encoding in the headers of an HTTP Post

Has anyone been able or is having trouble with setting the Content-Encoding
to a value in the headers collection of an HTTPWebRequest object.

I am trying to post a RosettaNet message to a trading partner that is using
webMethods server. The message gets to their server just fine but it is not
processing. They are telling me that the $contentEncoding has a value of
NULL. They are telling me that this is part of the Header information. I
have looked up the header property info on MSDN but I don't see anything
mentioned of setting the ContentEncoding.

Any one have suggestions.

Thanks,

Paul

Jun 23 '06 #1
2 11098
Thanks,
Could you tell me what or where I can find valid values for the
"Content-Encoding"? If I add it to the headers collection what are valid
values for it?

Would this be a valid value:

myWebHeaderCollection.Add("Content-Encoding", "UTF8")

Thanks,

paul
"Vadym Stetsyak" wrote:
Hello, Paul!

PP> I am trying to post a RosettaNet message to a trading partner that is
PP> using webMethods server. The message gets to their server just fine
PP> but it is not processing. They are telling me that the
PP> $contentEncoding has a value of NULL. They are telling me that this is
PP> part of the Header information. I have looked up the header property
PP> info on MSDN but I don't see anything mentioned of setting the
PP> ContentEncoding.

You can add this header manually, using HttpWebRequest.Headers collection.

Here comes short sample:

HttpWebRequest myHttpWebRequest = (HttpWebRequest) WebRequest.Create("http://www.msn.com");

//Get the headers associated with the request.
WebHeaderCollection myWebHeaderCollection = myHttpWebRequest.Headers;
myWebHeaderCollection.Add("Content-Encoding","gzip");

--
Regards, Vadym Stetsyak
www: http://vadmyst.blogspot

Jun 23 '06 #2
Thus wrote Paul,
Thanks,
Could you tell me what or where I can find valid values for the
"Content-Encoding"? If I add it to the headers collection what are
valid
values for it?
See http://www.w3.org/Protocols/rfc2616/...c3.html#sec3.5. Probably
RosettaNet defines its own additional headers, but I suspect what you're
really looking for is a way to set the character encoding of your message.
Would this be a valid value:

myWebHeaderCollection.Add("Content-Encoding", "UTF8")


Usually not, because a character encoding isn't a content encoding as defined
in http://www.w3.org/Protocols/rfc2616/....html#sec14.11. The character
encoding can be set using the Content-Type header, e.g.
Content-Type: text/xml; charset=UTF-8

Cheers,
--
Joerg Jooss
ne********@joergjooss.de
Jun 24 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: Bozo Schmozo | last post by:
Greetings! I've searched groups.google.com already to see if I can determine if using PHP/MySQL (if needed) for a web site I wish to develop. As the subject indicated, it will be a content...
5
by: Richard Light | last post by:
A literal-minded reading of the XML 1.0 Spec suggests that elements with content model ANY should not have comments or PIs as their immediate children. Is there a particular reason for this? ...
2
by: Catherine Lynn Wood | last post by:
I need to know how to overlap DIV content within 'relative' associated rendering. I am building div layers in the middle of a page and when I set positioning to absolute in the CSS, it references...
9
by: Michael Schuerig | last post by:
I'd like to mark input elements with class "invalid" by appending something, say a "?". My understanding is that it should work like this: input.invalid:after { content:"?"; } However, at...
14
by: j1c | last post by:
How can I remove the content in between tags? I have a page that has several custom tags: <!--tag:1--> Content 1 <!--/tag:1--> <br> <!--tag:2--> Content 2 <!--/tag:2--> <br> <!--tag:3--> Content 3...
10
by: clintonG | last post by:
Can somebody direct me to documents or source that supports the use of collapsible content that is collapsed by default when the page is loaded? The secondary objective would of course be...
10
by: Blue® | last post by:
I would like to call the content of content.htm (containing only HTML codes) into index.htm. This is usually done by renaming index.htm to index.shtml and use this tag: <!--#include...
7
by: Andrew Robinson | last post by:
Given HTML text (likely from SQL), is there any method that could be employed to render server and/or custom controls that are contained inside of that text? I would be loading content from a...
1
by: dave8421 | last post by:
Hi, I'm trying to make sense of the definition for "Rendered Content" in current CR for CSS 2.1 Is rendered content what is displayed on the particular media or device? from the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.