OSDN Git Service

値を持たずキー名のみのパラメータを渡せるようにした(ex. http://exaple.com/index.cgi?hoge )
authorsyo68k <syo68k@users.sourceforge.jp>
Tue, 5 Oct 2010 16:44:35 +0000 (16:44 +0000)
committerKimura Youichi <kim.upsilon@bucyou.net>
Sat, 18 Feb 2012 14:15:45 +0000 (23:15 +0900)
git-svn-id: http://svn.sourceforge.jp/svnroot/tween/trunk@938 e39ad16e-3079-482e-bb30-4b4d378143b6

Tween/Connection/HttpConnection.vb

index 4ea55f3..7dc2ffe 100644 (file)
@@ -463,7 +463,11 @@ Public Class HttpConnection
 
         Dim query As New StringBuilder
         For Each key As String In param.Keys
-            query.AppendFormat("{0}={1}&", UrlEncode(key), UrlEncode(param(key)))
+            If String.IsNullOrEmpty(param(key)) Then
+                query.AppendFormat("{0}&", UrlEncode(key))
+            Else
+                query.AppendFormat("{0}={1}&", UrlEncode(key), UrlEncode(param(key)))
+            End If
         Next
         Return query.ToString(0, query.Length - 1)
     End Function