@@ -81,6 +81,20 @@ public MyHTTPResponse(HttpWebResponse webResp)
8181 }
8282 }
8383
84+ private string AppendParamsToExistingQueryString ( string currentQueryString , Dictionary < string , string > parameters )
85+ {
86+ foreach ( KeyValuePair < String , String > entry in parameters )
87+ {
88+ if ( currentQueryString != "" )
89+ {
90+ currentQueryString += "&" ;
91+ }
92+ currentQueryString += HttpUtility . UrlEncode ( entry . Key ) + "=" + HttpUtility . UrlEncode ( entry . Value ) ;
93+ }
94+
95+ return currentQueryString ;
96+ }
97+
8498 private MyHTTPResponse MakeSyncRequest ( MyHTTPRequest req )
8599 {
86100 String url ;
@@ -97,21 +111,13 @@ private MyHTTPResponse MakeSyncRequest(MyHTTPRequest req)
97111 url += req . resource ;
98112 }
99113
100- if ( req . queryParams != null )
114+ String qs = "" ;
115+ qs = AppendParamsToExistingQueryString ( qs , req . queryParams ) ;
116+ qs = AppendParamsToExistingQueryString ( qs , extended ) ;
117+
118+ if ( qs != "" )
101119 {
102- String qs = "" ;
103- foreach ( KeyValuePair < String , String > entry in req . queryParams )
104- {
105- if ( qs != "" )
106- {
107- qs += "&" ;
108- }
109- qs += HttpUtility . UrlEncode ( entry . Key ) + "=" + HttpUtility . UrlEncode ( entry . Value ) ;
110- }
111- if ( qs != "" )
112- {
113- url += "?" + qs ;
114- }
120+ url += "?" + qs ;
115121 }
116122
117123 // TODO: handle special properties we recognize, such as content type, modified since, etc.
@@ -123,13 +129,11 @@ private MyHTTPResponse MakeSyncRequest(MyHTTPRequest req)
123129 {
124130 webReq . Headers . Add ( "Authorization" , auth ) ;
125131 }
126- if ( req . headers != null )
132+ foreach ( KeyValuePair < String , String > entry in req . headers )
127133 {
128- foreach ( KeyValuePair < String , String > entry in req . headers )
129- {
130- webReq . Headers . Add ( entry . Key , entry . Value ) ;
131- }
134+ webReq . Headers . Add ( entry . Key , entry . Value ) ;
132135 }
136+
133137
134138 if ( req . contentType != null )
135139 {
0 commit comments