Difference between revisions of "WebResponse class"

From Catglobe Wiki
Jump to: navigation, search
m
Line 20: Line 20:
 
{{CGscriptProperties_Template|ReturnType=string|Name=<nowiki>StatusDescription</nowiki>|HasGetter=1|Description=<nowiki>Gets the status description returned with the response.</nowiki>}}
 
{{CGscriptProperties_Template|ReturnType=string|Name=<nowiki>StatusDescription</nowiki>|HasGetter=1|Description=<nowiki>Gets the status description returned with the response.</nowiki>}}
 
{{CGscriptProperties_Template|ReturnType=TypeInformation|Name=<nowiki>TypeInformation</nowiki>|HasGetter=1|Description=<nowiki>Get information about this class.</nowiki>}}
 
{{CGscriptProperties_Template|ReturnType=TypeInformation|Name=<nowiki>TypeInformation</nowiki>|HasGetter=1|Description=<nowiki>Get information about this class.</nowiki>}}
}}
+
}}  
  
'''More information about an HTTP Message:''' [http://www.jmarshall.com/easy/http/ http://www.jmarshall.com/easy/http/]<br>
+
'''More information about an HTTP Message:''' [http://www.jmarshall.com/easy/http/ http://www.jmarshall.com/easy/http/]<br>  
  
 
==== <span style="color:#a52a2a;">Examples</span>  ====
 
==== <span style="color:#a52a2a;">Examples</span>  ====
Line 31: Line 31:
 
WebResponse wr = hr.GetResponse();
 
WebResponse wr = hr.GetResponse();
 
responseString = wr.Response();
 
responseString = wr.Response();
print(responseString);</source></span><br>
+
print(responseString);</source></span><br>  
  
 
[[Category:Data_Types_Literals_and_Variables]]
 
[[Category:Data_Types_Literals_and_Variables]]
 +
__NOTOC__

Revision as of 11:44, 7 November 2011

WebResponse



The response object from a http request


Methods

  • string Response() - The response from the request
  • string Response(string encoding "Encoding to use to read the reply - See .NET Encoding.GetEncoding for further info") - The response from the request with the encoding specified
  • string ToString() - The string representation of the object.

Properties

  • string CharacterSet { get; } - Gets the character set of the response.
  • string ContentEncoding { get; } - Gets the method that is used to encode the body of the response.
  • number ContentLength { get; } - Gets the number of bytes of the content returned by the request.
  • string ContentType { get; } - Gets the content type of the response.
  • Dictionary Headers { get; } - Gets the headers that are associated with this response from the server.
  • DateTime LastModified { get; } - Gets the last date and time that the contents of the response were modified.
  • string Method { get; } - Gets the method that is used to return the response.
  • string ObjectTypeName { get; } - The name of the type of object.
  • number StatusCode { get; } - Gets the status of the response.
  • string StatusDescription { get; } - Gets the status description returned with the response.
  • TypeInformation TypeInformation { get; } - Get information about this class.


More information about an HTTP Message: http://www.jmarshall.com/easy/http/

Examples

string uri = "http://google.com";
string responseString;
HttpRequest hr = new HttpRequest(uri);
WebResponse wr = hr.GetResponse();
responseString = wr.Response();
print(responseString);