In The Hand
Method Property
NamespacesInTheHand.NetObexWebRequestMethod
.NET Components for Mobility
Gets or sets the method for the request.
Declaration Syntax
C#Visual Basic
public override string Method { get; set; }
Public Overrides Property Method As String
Remarks

For Object Exchange the method code is mapped to the equivalent HTTP style method. For example "PUT", "GET" etc. "PUT" is the default value. There is new support for GET as of version 2.5.

To use GET change the Method to "GET" and you must also use scheme "obex-ftp" in the URL instead of the usual "obex" -- unless you know that the default OBEX server you are connecting supports GET.

For a PUT sample see the class documentation. For GET, see below.

Examples
CopyC#
' The host part of the URI is the device address, e.g. IrDAAddress.ToString(),
' and the file part is the OBEX object name.
Dim addr As String = "112233445566"
Dim uri As New Uri("obex-ftp://" & addr & "/HelloWorld.txt")
Dim req As New ObexWebRequest(uri)
req.Method = "GET"
Dim rsp As ObexWebResponse = CType(req.GetResponse(), ObexWebResponse)
Console.WriteLine("Response Code: {0} (0x{0:X})", rsp.StatusCode)
Using content As Stream = rsp.GetResponseStream()
   ' Using a StreamReader to read text from the stream...
   Using rdr As New StreamReader(content)
      While True
         Dim line As String = rdr.ReadLine()
         If line Is Nothing Then Exit While
         Console.WriteLine(line)
      End While
   End Using
End Using

Assembly: InTheHand.Net.Personal (Module: InTheHand.Net.Personal) Version: 3.0.0.0