File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11# CHANGELOG
2+ ## 0.1.23
3+ - Added form_params support.
24
35## 0.1.22
46- This version include support of call back function for prometheus config.
Original file line number Diff line number Diff line change 146146 ],
147147 ],
148148 ],
149+ // Sample API to test Form_params
149150
151+ 'formParams ' => [
152+ 'name ' => 'httpbin ' ,
153+ 'method ' => 'POST ' ,
154+ 'uri ' => '/post ' ,
155+ 'request_type ' => 'form_data ' ,
156+ 'form_params ' => [
157+ 'parameters ' => [
158+ 'revision ' => '{revision} ' ,
159+ ],
160+ ],
161+ 'mappings ' => [
162+ 'form_params ' => [
163+ 'revision ' => 'param.revision ' ,
164+ ],
165+ ],
166+ ],
150167 'delete ' => [
151168 'name ' => 'httpbin ' ,
152169 'method ' => 'DELETE ' ,
Original file line number Diff line number Diff line change @@ -82,5 +82,16 @@ public function testHttpBinPostXml()
8282 self ::assertEquals ('Barbarian ' , $ val ->attributes ->class [0 ]);
8383 self ::assertEquals ('http://mockbin.org/echo ' , $ response ->meta ->uri );
8484 }
85-
85+ public function testHttpBinPostFormParams ()
86+ {
87+ $ apibuilder = new ApiBuilder ();
88+ $ api = $ apibuilder ->api ('httpbin ' );
89+ $ api = $ api ->addHeaders (['Content-Type ' => 'application/x-www-form-urlencoded ' ]);
90+ $ response = $ api ->formParams (['param ' => ['revision ' => 'one ' ]]);
91+ self ::assertTrue ($ response ->success );
92+ self ::assertArrayHasKey ('form ' ,$ response ->body );
93+ self ::assertEquals ('https://httpbin.org/post ' , $ response ->meta ->uri );
94+ self ::assertEquals ($ api ->requestOptions ['headers ' ]['Content-Type ' ],'application/x-www-form-urlencoded ' );
95+ self ::assertEquals ('one ' ,$ response ->meta ->params ['form_params ' ]['parameters ' ]['revision ' ]);
96+ }
8697}
Original file line number Diff line number Diff line change @@ -152,7 +152,25 @@ private function returnconfig()
152152 ],
153153 ],
154154 ],
155+ // Sample API to test Form_params
155156
157+ 'formParams ' => [
158+ 'name ' => 'httpbin ' ,
159+ 'method ' => 'POST ' ,
160+ 'uri ' => '/post ' ,
161+ 'request_type ' => 'form_data ' ,
162+ 'form_params ' => [
163+ 'parameters ' => [
164+ 'revision ' => '{revision} ' ,
165+ ],
166+ ],
167+ 'mappings ' => [
168+ 'form_params ' => [
169+ 'revision ' => 'param.revision ' ,
170+ ],
171+ ],
172+ ],
173+
156174 'delete ' => [
157175 'name ' => 'httpbin ' ,
158176 'method ' => 'DELETE ' ,
You can’t perform that action at this time.
0 commit comments