Skip to content

Commit 4933b46

Browse files
committed
fix(test): proper serialization of JSON from previous Pull Request
1 parent bf0b6ce commit 4933b46

17 files changed

Lines changed: 17 additions & 17 deletions

File tree

test/fixtures/output/c/libcurl/application-json.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ struct curl_slist *headers = NULL;
77
headers = curl_slist_append(headers, "content-type: application/json");
88
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
99

10-
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\"number\":1,\"string\":\"f\\\"oo\",\"arr\":[1,2,3],\"nested\":{\"a\":\"b\"},\"arr_mix\":[1,\"a\",{\"arr_mix_nested\":{}}], \"boolean\": false}");
10+
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\"number\":1,\"string\":\"f\\\"oo\",\"arr\":[1,2,3],\"nested\":{\"a\":\"b\"},\"arr_mix\":[1,\"a\",{\"arr_mix_nested\":{}}],\"boolean\":false}");
1111

1212
CURLcode ret = curl_easy_perform(hnd);
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
var client = new RestClient("http://mockbin.com/har");
22
var request = new RestRequest(Method.POST);
33
request.AddHeader("content-type", "application/json");
4-
request.AddParameter("application/json", "{\"number\":1,\"string\":\"f\\\"oo\",\"arr\":[1,2,3],\"nested\":{\"a\":\"b\"},\"arr_mix\":[1,\"a\",{\"arr_mix_nested\":{}}], \"boolean\": false}", ParameterType.RequestBody);
4+
request.AddParameter("application/json", "{\"number\":1,\"string\":\"f\\\"oo\",\"arr\":[1,2,3],\"nested\":{\"a\":\"b\"},\"arr_mix\":[1,\"a\",{\"arr_mix_nested\":{}}],\"boolean\":false}", ParameterType.RequestBody);
55
IRestResponse response = client.Execute(request);

test/fixtures/output/go/native/application-json.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ func main() {
1111

1212
url := "http://mockbin.com/har"
1313

14-
payload := strings.NewReader("{\"number\":1,\"string\":\"f\\\"oo\",\"arr\":[1,2,3],\"nested\":{\"a\":\"b\"},\"arr_mix\":[1,\"a\",{\"arr_mix_nested\":{}}], \"boolean\": false}")
14+
payload := strings.NewReader("{\"number\":1,\"string\":\"f\\\"oo\",\"arr\":[1,2,3],\"nested\":{\"a\":\"b\"},\"arr_mix\":[1,\"a\",{\"arr_mix_nested\":{}}],\"boolean\":false}")
1515

1616
req, _ := http.NewRequest("POST", url, payload)
1717

test/fixtures/output/java/okhttp/application-json.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
OkHttpClient client = new OkHttpClient();
22

33
MediaType mediaType = MediaType.parse("application/json");
4-
RequestBody body = RequestBody.create(mediaType, "{\"number\":1,\"string\":\"f\\\"oo\",\"arr\":[1,2,3],\"nested\":{\"a\":\"b\"},\"arr_mix\":[1,\"a\",{\"arr_mix_nested\":{}}], \"boolean\": false}");
4+
RequestBody body = RequestBody.create(mediaType, "{\"number\":1,\"string\":\"f\\\"oo\",\"arr\":[1,2,3],\"nested\":{\"a\":\"b\"},\"arr_mix\":[1,\"a\",{\"arr_mix_nested\":{}}],\"boolean\":false}");
55
Request request = new Request.Builder()
66
.url("http://mockbin.com/har")
77
.post(body)
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
HttpResponse<String> response = Unirest.post("http://mockbin.com/har")
22
.header("content-type", "application/json")
3-
.body("{\"number\":1,\"string\":\"f\\\"oo\",\"arr\":[1,2,3],\"nested\":{\"a\":\"b\"},\"arr_mix\":[1,\"a\",{\"arr_mix_nested\":{}}], \"boolean\": false}")
3+
.body("{\"number\":1,\"string\":\"f\\\"oo\",\"arr\":[1,2,3],\"nested\":{\"a\":\"b\"},\"arr_mix\":[1,\"a\",{\"arr_mix_nested\":{}}],\"boolean\":false}")
44
.asString();

test/fixtures/output/javascript/jquery/application-json.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ var settings = {
77
"content-type": "application/json"
88
},
99
"processData": false,
10-
"data": "{\"number\":1,\"string\":\"f\\\"oo\",\"arr\":[1,2,3],\"nested\":{\"a\":\"b\"},\"arr_mix\":[1,\"a\",{\"arr_mix_nested\":{}}], \"boolean\": false}"
10+
"data": "{\"number\":1,\"string\":\"f\\\"oo\",\"arr\":[1,2,3],\"nested\":{\"a\":\"b\"},\"arr_mix\":[1,\"a\",{\"arr_mix_nested\":{}}],\"boolean\":false}"
1111
}
1212

1313
$.ajax(settings).done(function (response) {

test/fixtures/output/ocaml/cohttp/application-json.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ open Lwt
44

55
let uri = Uri.of_string "http://mockbin.com/har" in
66
let headers = Header.add (Header.init ()) "content-type" "application/json" in
7-
let body = Cohttp_lwt_body.of_string "{\"number\":1,\"string\":\"f\\\"oo\",\"arr\":[1,2,3],\"nested\":{\"a\":\"b\"},\"arr_mix\":[1,\"a\",{\"arr_mix_nested\":{}}], \"boolean\": false}" in
7+
let body = Cohttp_lwt_body.of_string "{\"number\":1,\"string\":\"f\\\"oo\",\"arr\":[1,2,3],\"nested\":{\"a\":\"b\"},\"arr_mix\":[1,\"a\",{\"arr_mix_nested\":{}}],\"boolean\":false}" in
88

99
Client.call ~headers ~body `POST uri
1010
>>= fun (res, body_stream) ->

test/fixtures/output/php/curl/application-json.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
CURLOPT_TIMEOUT => 30,
1111
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
1212
CURLOPT_CUSTOMREQUEST => "POST",
13-
CURLOPT_POSTFIELDS => "{\"number\":1,\"string\":\"f\\\"oo\",\"arr\":[1,2,3],\"nested\":{\"a\":\"b\"},\"arr_mix\":[1,\"a\",{\"arr_mix_nested\":{}}], \"boolean\": false}",
13+
CURLOPT_POSTFIELDS => "{\"number\":1,\"string\":\"f\\\"oo\",\"arr\":[1,2,3],\"nested\":{\"a\":\"b\"},\"arr_mix\":[1,\"a\",{\"arr_mix_nested\":{}}],\"boolean\":false}",
1414
CURLOPT_HTTPHEADER => array(
1515
"content-type: application/json"
1616
),

test/fixtures/output/php/http1/application-json.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
'content-type' => 'application/json'
99
));
1010

11-
$request->setBody('{"number":1,"string":"f\\"oo","arr":[1,2,3],"nested":{"a":"b"},"arr_mix":[1,"a",{"arr_mix_nested":{}}], "boolean": false}');
11+
$request->setBody('{"number":1,"string":"f\\"oo","arr":[1,2,3],"nested":{"a":"b"},"arr_mix":[1,"a",{"arr_mix_nested":{}}],"boolean":false}');
1212

1313
try {
1414
$response = $request->send();

test/fixtures/output/php/http2/application-json.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
$request = new http\Client\Request;
55

66
$body = new http\Message\Body;
7-
$body->append('{"number":1,"string":"f\\"oo","arr":[1,2,3],"nested":{"a":"b"},"arr_mix":[1,"a",{"arr_mix_nested":{}}], "boolean": false}');
7+
$body->append('{"number":1,"string":"f\\"oo","arr":[1,2,3],"nested":{"a":"b"},"arr_mix":[1,"a",{"arr_mix_nested":{}}],"boolean":false}');
88

99
$request->setRequestUrl('http://mockbin.com/har');
1010
$request->setRequestMethod('POST');

0 commit comments

Comments
 (0)