Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Imports System.Collections.Specialized
- Namespace Sitesource.Network
- ''' <summary>
- ''' Utility class
- ''' </summary>
- ''' <remarks></remarks>
- Public Class Util
- Public Const RequestMethodPOST As String = "POST"
- Public Const RequestMethodGET As String = "GET"
- Public Const FormContentType As String = "application/x-www-form-urlencoded"
- ''' <summary>
- ''' Creates a post string from the given parameters NameValueCollection.
- ''' </summary>
- ''' <param name="parameters">Post data.</param>
- ''' <returns></returns>
- ''' <remarks></remarks>
- Public Shared Function GetPostString(ByVal parameters As NameValueCollection) As String
- Return String.Join("&", Array.ConvertAll(parameters.AllKeys, New Converter(Of String, String)(Function(key As String) String.Format("{0}={1}", key, parameters.Item(key)))))
- End Function
- End Class
- End Namespace
Advertisement
Add Comment
Please, Sign In to add comment