update template code
This commit is contained in:
1 parent
ba74345be1
commit
df76f2b35a
8 files changed
+78
-21
No files matched your search
@@ -1,6 +1,6 @@
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
{{#body}}
|
||||
jsonObject.put("{{{key}}}", "{{{value}}}");
|
||||
jsonObject.put("{{{key}}}", {{{value}}});
|
||||
{{/body}}
|
||||
MediaType mediaType = "application/json; charset=utf-8".toMediaType();
|
||||
RequestBody body = jsonObject.toString().toRequestBody(mediaType);
|
||||
@@ -8,7 +8,7 @@ Request request = new Request.Builder()
|
||||
.url("{{{url}}}")
|
||||
.{{{method}}}(body)
|
||||
{{#headers}}
|
||||
.addHeader("{{{key}}}", "{{{value}}}")
|
||||
.addHeader("{{{key}}}", {{{value}}})
|
||||
{{/headers}}
|
||||
.build();
|
||||
|
||||
|
||||
@@ -2,12 +2,12 @@ const options = {
|
||||
method: '{{{method}}}',
|
||||
headers: {
|
||||
{{#headers}}
|
||||
'{{{key}}}': '{{{value}}}'{{^last}},{{/last}}
|
||||
'{{{key}}}': {{{value}}}{{^last}},{{/last}}
|
||||
{{/headers}}
|
||||
},
|
||||
body: JSON.stringify({
|
||||
{{#body}}
|
||||
{{{key}}}: '{{{value}}}'{{^last}},{{/last}}
|
||||
'{{{key}}}': {{{value}}}{{^last}},{{/last}}
|
||||
{{/body}}
|
||||
})
|
||||
};
|
||||
|
||||
@@ -6,12 +6,12 @@ $client = new \GuzzleHttp\Client();
|
||||
$response = $client->request('{{{method}}}', '{{{url}}}', [
|
||||
'body' => '{
|
||||
{{#body}}
|
||||
"{{{key}}}": "{{{value}}}"{{^last}},{{/last}}
|
||||
"{{{key}}}": {{{value}}}{{^last}},{{/last}}
|
||||
{{/body}}
|
||||
}',
|
||||
'headers' => [
|
||||
{{#headers}}
|
||||
'{{{key}}}': '{{{value}}}'{{^last}},{{/last}}
|
||||
'{{{key}}}': {{{value}}}{{^last}},{{/last}}
|
||||
{{/headers}}
|
||||
],
|
||||
]);
|
||||
|
||||
@@ -4,13 +4,13 @@ url = '{{{url}}}'
|
||||
|
||||
headers = {
|
||||
{{#headers}}
|
||||
'{{{key}}}': '{{{value}}}'{{^last}},{{/last}}
|
||||
'{{{key}}}': {{{value}}}{{^last}},{{/last}}
|
||||
{{/headers}}
|
||||
}
|
||||
|
||||
payload = {
|
||||
{{#body}}
|
||||
'{{{key}}}': '{{{value}}}'{{^last}},{{/last}}
|
||||
'{{{key}}}': {{{value}}}{{^last}},{{/last}}
|
||||
{{/body}}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user