C# Класс OpenSim.Framework.WebUtil

Miscellaneous static methods and extension methods related to the web
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
AppendQuery ( this uri, string query ) : string

Appends a query string to a Uri that may or may not have existing query parameters

BuildQueryString ( NameValueCollection parameters ) : string

Convert a NameValueCollection into a query string. This is the inverse of HttpUtility.ParseQueryString()

Combine ( this uri, Uri fragment ) : Uri

Combines a Uri that can contain both a base Uri and relative path with a second relative path fragment. If the fragment is absolute, it will be returned without modification

Combine ( this uri, string fragment ) : Uri

Combines a Uri that can contain both a base Uri and relative path with a second relative path fragment

This is similar to the Uri constructor that takes a base Uri and the relative path, except this method can append a relative path fragment on to an existing relative path

CopyTo ( this copyFrom, Stream copyTo, int maximumBytesToCopy ) : int

Copies the contents of one stream to another, starting at the current position of each stream

Copying begins at the streams' current positions. The positions are NOT reset after copying is complete.

GetOne ( this collection, string key ) : string

GetStreamString ( this stream ) : string

Converts an entire stream to a string, regardless of current stream position

When this method is done, the stream position will be reset to its previous position before this method was called

PostToService ( string url, NameValueCollection data ) : OSDMap

POST URL-encoded form data to a web service that returns LLSD or JSON data

SendJSONResponse ( OpenSim.Framework.Servers.HttpServer.OSHttpResponse response, OSDMap body ) : void

Send LLSD to an HTTP client in application/llsd+json form

SendXMLResponse ( OpenSim.Framework.Servers.HttpServer.OSHttpResponse response, OSDMap body ) : void

Send LLSD to an HTTP client in application/llsd+xml form

ServiceRequest ( string url, string httpVerb ) : OSDMap

Make a GET or GET-like request to a web service that returns LLSD or JSON data

Описание методов

AppendQuery() публичный статический Метод

Appends a query string to a Uri that may or may not have existing query parameters
public static AppendQuery ( this uri, string query ) : string
uri this Uri to append the query to
query string Query string to append. Can either start with ? /// or just containg key/value pairs
Результат string

BuildQueryString() публичный статический Метод

Convert a NameValueCollection into a query string. This is the inverse of HttpUtility.ParseQueryString()
public static BuildQueryString ( NameValueCollection parameters ) : string
parameters System.Collections.Specialized.NameValueCollection Collection of key/value pairs to convert
Результат string

Combine() публичный статический Метод

Combines a Uri that can contain both a base Uri and relative path with a second relative path fragment. If the fragment is absolute, it will be returned without modification
public static Combine ( this uri, Uri fragment ) : Uri
uri this Starting (base) Uri
fragment System.Uri Relative path fragment to append to the end /// of the Uri, or an absolute Uri to return unmodified
Результат System.Uri

Combine() публичный статический Метод

Combines a Uri that can contain both a base Uri and relative path with a second relative path fragment
This is similar to the Uri constructor that takes a base Uri and the relative path, except this method can append a relative path fragment on to an existing relative path
public static Combine ( this uri, string fragment ) : Uri
uri this Starting (base) Uri
fragment string Relative path fragment to append to the end /// of the Uri
Результат System.Uri

CopyTo() публичный статический Метод

Copies the contents of one stream to another, starting at the current position of each stream
Copying begins at the streams' current positions. The positions are NOT reset after copying is complete.
public static CopyTo ( this copyFrom, Stream copyTo, int maximumBytesToCopy ) : int
copyFrom this The stream to copy from, at the position /// where copying should begin
copyTo Stream The stream to copy to, at the position where /// bytes should be written
maximumBytesToCopy int The maximum bytes to copy
Результат int

GetOne() публичный статический Метод

public static GetOne ( this collection, string key ) : string
collection this
key string
Результат string

GetStreamString() публичный статический Метод

Converts an entire stream to a string, regardless of current stream position
When this method is done, the stream position will be reset to its previous position before this method was called
public static GetStreamString ( this stream ) : string
stream this The stream to convert to a string
Результат string

PostToService() публичный статический Метод

POST URL-encoded form data to a web service that returns LLSD or JSON data
public static PostToService ( string url, NameValueCollection data ) : OSDMap
url string
data System.Collections.Specialized.NameValueCollection
Результат OSDMap

SendJSONResponse() публичный статический Метод

Send LLSD to an HTTP client in application/llsd+json form
public static SendJSONResponse ( OpenSim.Framework.Servers.HttpServer.OSHttpResponse response, OSDMap body ) : void
response OpenSim.Framework.Servers.HttpServer.OSHttpResponse HTTP response to send the data in
body OSDMap LLSD to send to the client
Результат void

SendXMLResponse() публичный статический Метод

Send LLSD to an HTTP client in application/llsd+xml form
public static SendXMLResponse ( OpenSim.Framework.Servers.HttpServer.OSHttpResponse response, OSDMap body ) : void
response OpenSim.Framework.Servers.HttpServer.OSHttpResponse HTTP response to send the data in
body OSDMap LLSD to send to the client
Результат void

ServiceRequest() публичный статический Метод

Make a GET or GET-like request to a web service that returns LLSD or JSON data
public static ServiceRequest ( string url, string httpVerb ) : OSDMap
url string
httpVerb string
Результат OSDMap