File: WebHeaderCollection.xml

package info (click to toggle)
monodoc 1.1.18-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 58,432 kB
  • ctags: 4,991
  • sloc: xml: 718,392; cs: 38,337; sh: 3,172; perl: 554; makefile: 303
file content (521 lines) | stat: -rwxr-xr-x 20,335 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
<Type Name="WebHeaderCollection" FullName="System.Net.WebHeaderCollection" FullNameSP="System_Net_WebHeaderCollection" Maintainer="ecma">
  <TypeSignature Language="ILASM" Value=".class public serializable WebHeaderCollection extends System.Collections.Specialized.NameValueCollection" />
  <TypeSignature Language="C#" Value="public class WebHeaderCollection : NameValueCollection" />
  <MemberOfLibrary>Networking</MemberOfLibrary>
  <AssemblyInfo>
    <AssemblyName>System</AssemblyName>
    <AssemblyPublicKey>[00 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00 ]</AssemblyPublicKey>
    <AssemblyVersion>1.0.x.x</AssemblyVersion>
    <AssemblyCulture>none</AssemblyCulture>
    <Attributes>
      <Attribute>
        <AttributeName>CLSCompliantAttribute(true)</AttributeName>
        <Excluded>0</Excluded>
      </Attribute>
    </Attributes>
  </AssemblyInfo>
  <ThreadingSafetyStatement>All public static members of this type are safe for multithreaded operations. No instance members are guaranteed to be thread safe.</ThreadingSafetyStatement>
  <Docs>
    <summary>
      <para>Contains protocol headers associated with a <see cref="T:System.Net.WebRequest" /> or
<see cref="T:System.Net.WebResponse" /> instance.</para>
    </summary>
    <remarks>
      <para>This class is generally accessed through <see cref="P:System.Net.WebRequest.Headers" qualify="true" /> or <see cref="P:System.Net.WebResponse.Headers" qualify="true" />
.</para>
      <para> 
   Certain protocol headers are protected and cannot be set directly in a <see cref="T:System.Net.WebHeaderCollection" /> instance. These headers
   can only be set through provided property accessors or by the system. The
   protected headers are:</para>
      <list type="bullet">
        <item>
          <term>
      
      Accept</term>
        </item>
        <item>
          <term>
      
      Connection</term>
        </item>
        <item>
          <term>
      
      Content-Length</term>
        </item>
        <item>
          <term>
      
      Content-Type</term>
        </item>
        <item>
          <term>
      
      Date</term>
        </item>
        <item>
          <term>
      
      Expect</term>
        </item>
        <item>
          <term>
      
      Host</term>
        </item>
        <item>
          <term>
      
      If-Modified-Since</term>
        </item>
        <item>
          <term>
      
      Range</term>
        </item>
        <item>
          <term>
      
      Referer</term>
        </item>
        <item>
          <term>
      
      Transfer-Encoding</term>
        </item>
        <item>
          <term>
      
      UserAgent</term>
        </item>
      </list>
    </remarks>
  </Docs>
  <Base>
    <BaseTypeName>System.Collections.Specialized.NameValueCollection</BaseTypeName>
  </Base>
  <Interfaces>
    <Interface>
      <InterfaceName>System.Collections.ICollection</InterfaceName>
      <Excluded>0</Excluded>
    </Interface>
    <Interface>
      <InterfaceName>System.Collections.IEnumerable</InterfaceName>
      <Excluded>0</Excluded>
    </Interface>
  </Interfaces>
  <Attributes>
    <Attribute>
      <AttributeName>DefaultMemberAttribute("Item")</AttributeName>
      <Excluded>1</Excluded>
      <ExcludedTypeName>System.Reflection.DefaultMemberAttribute</ExcludedTypeName>
      <ExcludedLibraryName>RuntimeInfrastructure</ExcludedLibraryName>
    </Attribute>
  </Attributes>
  <Members>
    <Member MemberName="Remove">
      <MemberSignature Language="ILASM" Value=".method public hidebysig virtual void Remove(string name)" />
      <MemberSignature Language="C#" Value="public override void Remove(string name);" />
      <MemberType>Method</MemberType>
      <ReturnValue>
        <ReturnType>System.Void</ReturnType>
      </ReturnValue>
      <Parameters>
		<Parameter Name="name" Type="System.String" />
	</Parameters>
      <Docs>
        <summary>
          <para>Removes the specified header from the current instance.</para>
        </summary>
        <param name="name">A <see cref="T:System.String" /> that contains the name of the header to remove from the current instance.</param>
        <exception cref="T:System.ArgumentNullException">
          <paramref name="name" /> is <see langword="null" /> or <see cref="F:System.String.Empty" />.</exception>
        <exception cref="T:System.ArgumentException">
          <para>
            <paramref name="name " /> contains invalid characters.</para>
          <para>-or-</para>
          <para>
            <paramref name="name " /> is a protected header that can only be set with a property accessor or by the system.</para>
        </exception>
        <remarks>
          <para>This method deletes the specified header from the current instance. If
      the same header was added multiple times with <see cref="M:System.Net.WebHeaderCollection.Add(System.String,System.String)" />, a single call to <see cref="M:System.Net.WebHeaderCollection.Remove(System.String)" /> deletes all of the headers.</para>
          <para>
            <block subset="none" type="note">This method overrides <see cref="M:System.Collections.Specialized.NameValueCollection.Remove(System.String)" />.</block>
          </para>
        </remarks>
      </Docs>
      <Excluded>0</Excluded>
    </Member>
    <Member MemberName="Set">
      <MemberSignature Language="ILASM" Value=".method public hidebysig virtual void Set(string name, string value)" />
      <MemberSignature Language="C#" Value="public override void Set(string name, string value);" />
      <MemberType>Method</MemberType>
      <ReturnValue>
        <ReturnType>System.Void</ReturnType>
      </ReturnValue>
      <Parameters>
		<Parameter Name="name" Type="System.String" />
		<Parameter Name="value" Type="System.String" />
	</Parameters>
      <Docs>
        <summary>
          <para> Sets the specified header to the specified value.
      </para>
        </summary>
        <param name="name">A <see cref="T:System.String" /> that contains the name of the header to set. </param>
        <param name=" value">A <see cref="T:System.String" /> that contains the content of the header to set. </param>
        <exception cref="T:System.ArgumentNullException">
          <paramref name="name" /> is <see langword="null" /> or <see cref="F:System.String.Empty" />.</exception>
        <exception cref="T:System.ArgumentException">
          <para>
            <paramref name="name " /> contains invalid characters.</para>
          <para>-or-</para>
          <para>
            <paramref name="name " /> is a protected header that can only be set with a property accessor or by the system.</para>
          <para> -or-</para>
          <para>
            <paramref name="value " /> contains invalid characters.</para>
        </exception>
        <remarks>
          <para>The <see cref="M:System.Net.WebHeaderCollection.Set(System.String,System.String)" /> method inserts a new header into 
   the list of header name/value pairs.</para>
          <para>If the header specified in <paramref name="name" /> is already
present, <paramref name="value" /> replaces the existing
value.</para>
          <para>
            <block subset="none" type="note">This method overrides <see cref="M:System.Collections.Specialized.NameValueCollection.Set(System.String,System.String)" />.</block>
          </para>
        </remarks>
      </Docs>
      <Excluded>0</Excluded>
    </Member>
    <Member MemberName="GetValues">
      <MemberSignature Language="ILASM" Value=".method public hidebysig virtual class System.String[] GetValues(string header)" />
      <MemberSignature Language="C#" Value="public override string[] GetValues(string header);" />
      <MemberType>Method</MemberType>
      <ReturnValue>
        <ReturnType>System.String[]</ReturnType>
      </ReturnValue>
      <Parameters>
		<Parameter Name="header" Type="System.String" />
	</Parameters>
      <Docs>
        <summary>
          <para> Returns the values stored in the specified protocol
      header.
      </para>
        </summary>
        <param name="header">A <see cref="T:System.String" /> containing the protocol header name whose values are returned. </param>
        <returns>
          <para> An array of <see cref="T:System.String" /> objects that contain the values of the protocol
   header named <paramref name="header" />
   in the current instance. If <paramref name="header " />is not found in the current
   instance, returns <see langword="null" /> .
   </para>
        </returns>
        <remarks>
          <para>
            <block subset="none" type="note">This method overrides <see cref="M:System.Collections.Specialized.NameValueCollection.GetValues(System.String)" />.</block>
          </para>
        </remarks>
        <example>
          <para>This example demonstrates the <see cref="M:System.Net.WebHeaderCollection.GetValues(System.String)" /> method.</para>
          <code lang="C#">
using System;
using System.Net;

class GetValuesExample
{
   public static void Main()
   {
      Uri contosoUri = new Uri("http://www.contoso.com");
      HttpWebRequest httpContoso = 
         (HttpWebRequest)WebRequest.Create(contosoUri);

      httpContoso.SendChunked=true;
      httpContoso.TransferEncoding="compress";
      httpContoso.TransferEncoding="gzip";
    
      WebHeaderCollection webColl = httpContoso.Headers;
      String[] sAry = webColl.GetValues("Transfer-Encoding");

      Console.WriteLine("Transfer-Encoding:");
      foreach(string s in sAry)
         Console.WriteLine("{0}", s);
   }
}
</code>
          <para>The output is</para>
          <para>
Transfer-Encoding:</para>
          <para> compress</para>
          <para> gzip
</para>
        </example>
      </Docs>
      <Excluded>0</Excluded>
    </Member>
    <Member MemberName="Add">
      <MemberSignature Language="ILASM" Value=".method public hidebysig virtual void Add(string name, string value)" />
      <MemberSignature Language="C#" Value="public override void Add(string name, string value);" />
      <MemberType>Method</MemberType>
      <ReturnValue>
        <ReturnType>System.Void</ReturnType>
      </ReturnValue>
      <Parameters>
		<Parameter Name="name" Type="System.String" />
		<Parameter Name="value" Type="System.String" />
	</Parameters>
      <Docs>
        <summary>
          <para>Inserts a new header with the specified name and value into the collection.</para>
        </summary>
        <param name="name">A <see cref="T:System.String" /> that contains the name of the header to add to the collection.</param>
        <param name=" value">A <see cref="T:System.String" /> that contains the content of the header.</param>
        <exception cref="T:System.ArgumentException">
          <para>
            <paramref name="name " /> is <see langword="null" /> or <see cref="F:System.String.Empty" />, or contains invalid characters.</para>
          <para>-or-</para>
          <para>
            <paramref name="name" /> is a protected header that can only be set with a property accessor or by the system.</para>
          <para>-or-</para>
          <para>
            <paramref name="value" /> contains invalid characters.</para>
        </exception>
        <remarks>
          <para>This method inserts
      a new header into
      the list of header name/value pairs.</para>
          <para> If the header specified in <paramref name="name" /> is already present, <paramref name="value" /> is concatenated with the existing
   value.</para>
          <para>
            <block subset="none" type="note">This method overrides <see cref="M:System.Collections.Specialized.NameValueCollection.Add(System.Collections.Specialized.NameValueCollection)" />.</block>
          </para>
        </remarks>
      </Docs>
      <Excluded>0</Excluded>
    </Member>
    <Member MemberName="AddWithoutValidate">
      <MemberSignature Language="ILASM" Value=".method family hidebysig instance void AddWithoutValidate(string headerName, string headerValue)" />
      <MemberSignature Language="C#" Value="protected void AddWithoutValidate(string headerName, string headerValue);" />
      <MemberType>Method</MemberType>
      <ReturnValue>
        <ReturnType>System.Void</ReturnType>
      </ReturnValue>
      <Parameters>
		<Parameter Name="headerName" Type="System.String" />
		<Parameter Name="headerValue" Type="System.String" />
	</Parameters>
      <Docs>
        <summary>
          <para>Inserts a header into the current instance without checking whether the header
      is on the restricted header list.</para>
        </summary>
        <param name="headerName">A <see cref="T:System.String" /> that contains the name of the header to add to the collection.</param>
        <param name="headerValue">A <see cref="T:System.String" /> that contains the content of the header.</param>
        <exception cref="T:System.ArgumentException">
          <para>
            <paramref name="headerName " /> is <see langword="null" /> or <see cref="F:System.String.Empty" />, or contains invalid characters.</para>
          <para>-or-</para>
          <para>
            <paramref name="headerValue" /> contains invalid characters.</para>
        </exception>
        <remarks>
          <para>This method adds a header to the
      collection without checking whether the header is on the restricted header list. </para>
          <para>
            <block subset="none" type="note">When subclassing <see cref="T:System.Net.WebHeaderCollection" />,
   use the <see cref="M:System.Net.WebHeaderCollection.AddWithoutValidate(System.String,System.String)" />
   method
   to
   
   add headers that are normally exposed through
   property accessors. </block>
          </para>
        </remarks>
      </Docs>
      <Excluded>0</Excluded>
    </Member>
    <Member MemberName="Add">
      <MemberSignature Language="ILASM" Value=".method public hidebysig instance void Add(string header)" />
      <MemberSignature Language="C#" Value="public void Add(string header);" />
      <MemberType>Method</MemberType>
      <ReturnValue>
        <ReturnType>System.Void</ReturnType>
      </ReturnValue>
      <Parameters>
		<Parameter Name="header" Type="System.String" />
	</Parameters>
      <Docs>
        <summary>
          <para>Inserts the specified header into the collection.</para>
        </summary>
        <param name="header">A <see cref="T:System.String" /> containing the header to add, with the name and value separated by a colon.</param>
        <exception cref="T:System.ArgumentNullException">
          <paramref name="header " /> is <see langword="null" /> or <see cref="F:System.String.Empty" />.</exception>
        <exception cref="T:System.ArgumentException">
          <para>
            <paramref name="header" /> does not contain a colon (:) character.</para>
          <para>-or-</para>
          <para>
            <c>name</c> is <see cref="F:System.String.Empty" />, or contains invalid characters.</para>
          <para>-or-</para>
          <para>
            <paramref name="header" /> is a protected header that can only be set with a property accessor or by the system. </para>
          <para>-or-</para>
          <para>
            <c>value</c> contains invalid characters.</para>
        </exception>
        <remarks>
          <para>This method inserts a new header into the list of header 
      name/value pairs. <paramref name="header" />
      is required to be specified in the format <c>name:value</c>.</para>
          <para>If the header specified in <c>name</c> is already present in the
   collection, <c>value</c> is concatenated with the existing
value.</para>
        </remarks>
      </Docs>
      <Excluded>0</Excluded>
    </Member>
    <Member MemberName="IsRestricted">
      <MemberSignature Language="ILASM" Value=".method public hidebysig static bool IsRestricted(string headerName)" />
      <MemberSignature Language="C#" Value="public static bool IsRestricted(string headerName);" />
      <MemberType>Method</MemberType>
      <ReturnValue>
        <ReturnType>System.Boolean</ReturnType>
      </ReturnValue>
      <Parameters>
		<Parameter Name="headerName" Type="System.String" />
	</Parameters>
      <Docs>
        <summary>
          <para> Returns a <see cref="T:System.Boolean" /> value that indicates whether the specified HTTP header can be set.</para>
        </summary>
        <param name="headerName">A <see cref="T:System.String" /> containing the header to test.</param>
        <returns>
          <para>
            <see langword="true" /> if
   the header is protected; otherwise <see langword="false" /> .</para>
        </returns>
        <exception cref="T:System.ArgumentNullException">
          <paramref name="headerName" /> is <see langword="null" /> or <see cref="F:System.String.Empty" />.</exception>
        <exception cref="T:System.ArgumentException">
          <para>
            <paramref name="headerName " /> contains invalid characters.</para>
        </exception>
        <remarks>
          <para>This method returns <see langword="true" /> to indicate that a header is
   protected. Protected headers can only be set through provided property accessors or by the
   system. They cannot be set directly in the current instance.</para>
          <para>The protected headers are:</para>
          <list type="bullet">
            <item>
              <term>
      
      Accept</term>
            </item>
            <item>
              <term>
      
      Connection</term>
            </item>
            <item>
              <term>
      
      Content-Length</term>
            </item>
            <item>
              <term>
      
      Content-Type</term>
            </item>
            <item>
              <term>
      
      Date</term>
            </item>
            <item>
              <term>
      
      Expect</term>
            </item>
            <item>
              <term>
      
      Host</term>
            </item>
            <item>
              <term>
      
      If-Modified-Since</term>
            </item>
            <item>
              <term>
      
      Range</term>
            </item>
            <item>
              <term>
      
      Referer</term>
            </item>
            <item>
              <term>
      
      Transfer-Encoding</term>
            </item>
            <item>
              <term>
      
      UserAgent</term>
            </item>
          </list>
        </remarks>
      </Docs>
      <Excluded>0</Excluded>
    </Member>
    <Member MemberName=".ctor">
      <MemberSignature Language="ILASM" Value="public rtspecialname specialname instance void .ctor()" />
      <MemberSignature Language="C#" Value="public WebHeaderCollection();" />
      <MemberType>Constructor</MemberType>
      <ReturnValue />
      <Parameters />
      <Docs>
        <summary>
          <para> Constructs a new instance of the <see cref="T:System.Net.WebHeaderCollection" />
class.</para>
        </summary>
      </Docs>
      <Excluded>0</Excluded>
    </Member>
  <Member MemberName=".ctor">
      <MemberSignature Language="C#" Value="protected WebHeaderCollection(System.Runtime.Serialization.SerializationInfo serializationInfo, System.Runtime.Serialization.StreamingContext streamingContext)" />
      <MemberType>Constructor</MemberType>
      <Parameters>
        <Parameter Name="serializationInfo" Type="System.Runtime.Serialization.SerializationInfo" />
        <Parameter Name="streamingContext" Type="System.Runtime.Serialization.StreamingContext" />
      </Parameters>
      <Docs>
        <summary>To be added.</summary>
        <param name="serializationInfo">To be added.</param>
        <param name="streamingContext">To be added.</param>
        <remarks>To be added.</remarks>
      </Docs>
    </Member>
  <Member MemberName="ToByteArray">
      <MemberSignature Language="C#" Value="public byte[] ToByteArray()" />
      <MemberType>Method</MemberType>
      <ReturnValue>
        <ReturnType>System.Byte[]</ReturnType>
      </ReturnValue>
      <Parameters />
      <Docs>
        <summary>To be added.</summary>
        <returns>To be added.</returns>
        <remarks>To be added.</remarks>
      </Docs>
    </Member>
  </Members>
  <TypeExcluded>0</TypeExcluded>
</Type>