@readme/httpsnippet 6.2.1 → 7.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunk-XPUGYZ4Y.mjs +3485 -0
- package/dist/chunk-XPUGYZ4Y.mjs.map +1 -0
- package/dist/index-acc66e3d.d.ts +167 -0
- package/dist/index.d.mts +4 -0
- package/dist/index.d.ts +4 -95
- package/dist/index.js +3777 -261
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +299 -0
- package/dist/index.mjs.map +1 -0
- package/dist/targets/targets.d.mts +4 -0
- package/dist/targets/targets.d.ts +4 -53
- package/dist/targets/targets.js +3476 -113
- package/dist/targets/targets.js.map +1 -0
- package/dist/targets/targets.mjs +3 -0
- package/dist/targets/targets.mjs.map +1 -0
- package/package.json +40 -14
- package/dist/helpers/code-builder.d.ts +0 -49
- package/dist/helpers/code-builder.js +0 -91
- package/dist/helpers/escape.d.ts +0 -46
- package/dist/helpers/escape.js +0 -101
- package/dist/helpers/form-data.d.ts +0 -30
- package/dist/helpers/form-data.js +0 -157
- package/dist/helpers/headers.d.ts +0 -18
- package/dist/helpers/headers.js +0 -33
- package/dist/helpers/reducer.d.ts +0 -5
- package/dist/helpers/reducer.js +0 -19
- package/dist/helpers/shell.d.ts +0 -6
- package/dist/helpers/shell.js +0 -20
- package/dist/helpers/utils.d.ts +0 -6
- package/dist/helpers/utils.js +0 -21
- package/dist/targets/c/libcurl/client.d.ts +0 -2
- package/dist/targets/c/libcurl/client.js +0 -45
- package/dist/targets/c/target.d.ts +0 -2
- package/dist/targets/c/target.js +0 -16
- package/dist/targets/clojure/clj_http/client.d.ts +0 -11
- package/dist/targets/clojure/clj_http/client.js +0 -178
- package/dist/targets/clojure/target.d.ts +0 -2
- package/dist/targets/clojure/target.js +0 -15
- package/dist/targets/csharp/httpclient/client.d.ts +0 -2
- package/dist/targets/csharp/httpclient/client.js +0 -163
- package/dist/targets/csharp/restsharp/client.d.ts +0 -2
- package/dist/targets/csharp/restsharp/client.js +0 -92
- package/dist/targets/csharp/target.d.ts +0 -2
- package/dist/targets/csharp/target.js +0 -18
- package/dist/targets/go/native/client.d.ts +0 -17
- package/dist/targets/go/native/client.js +0 -103
- package/dist/targets/go/target.d.ts +0 -2
- package/dist/targets/go/target.js +0 -16
- package/dist/targets/http/http1.1/client.d.ts +0 -23
- package/dist/targets/http/http1.1/client.js +0 -69
- package/dist/targets/http/target.d.ts +0 -2
- package/dist/targets/http/target.js +0 -15
- package/dist/targets/java/asynchttp/client.d.ts +0 -11
- package/dist/targets/java/asynchttp/client.js +0 -45
- package/dist/targets/java/nethttp/client.d.ts +0 -14
- package/dist/targets/java/nethttp/client.js +0 -44
- package/dist/targets/java/okhttp/client.d.ts +0 -11
- package/dist/targets/java/okhttp/client.js +0 -71
- package/dist/targets/java/target.d.ts +0 -2
- package/dist/targets/java/target.js +0 -21
- package/dist/targets/java/unirest/client.d.ts +0 -11
- package/dist/targets/java/unirest/client.js +0 -45
- package/dist/targets/javascript/axios/client.d.ts +0 -11
- package/dist/targets/javascript/axios/client.js +0 -92
- package/dist/targets/javascript/axios/fixtures/application-form-encoded.d.ts +0 -1
- package/dist/targets/javascript/axios/fixtures/application-form-encoded.js +0 -23
- package/dist/targets/javascript/axios/fixtures/application-json.d.ts +0 -1
- package/dist/targets/javascript/axios/fixtures/application-json.js +0 -27
- package/dist/targets/javascript/axios/fixtures/cookies.d.ts +0 -1
- package/dist/targets/javascript/axios/fixtures/cookies.js +0 -19
- package/dist/targets/javascript/axios/fixtures/custom-method.d.ts +0 -1
- package/dist/targets/javascript/axios/fixtures/custom-method.js +0 -15
- package/dist/targets/javascript/axios/fixtures/full.d.ts +0 -1
- package/dist/targets/javascript/axios/fixtures/full.js +0 -27
- package/dist/targets/javascript/axios/fixtures/headers.d.ts +0 -1
- package/dist/targets/javascript/axios/fixtures/headers.js +0 -24
- package/dist/targets/javascript/axios/fixtures/http-insecure.d.ts +0 -1
- package/dist/targets/javascript/axios/fixtures/http-insecure.js +0 -15
- package/dist/targets/javascript/axios/fixtures/jsonObj-multiline.d.ts +0 -1
- package/dist/targets/javascript/axios/fixtures/jsonObj-multiline.js +0 -20
- package/dist/targets/javascript/axios/fixtures/jsonObj-null-value.d.ts +0 -1
- package/dist/targets/javascript/axios/fixtures/jsonObj-null-value.js +0 -20
- package/dist/targets/javascript/axios/fixtures/multipart-data.d.ts +0 -1
- package/dist/targets/javascript/axios/fixtures/multipart-data.js +0 -23
- package/dist/targets/javascript/axios/fixtures/multipart-file.d.ts +0 -1
- package/dist/targets/javascript/axios/fixtures/multipart-file.js +0 -22
- package/dist/targets/javascript/axios/fixtures/multipart-form-data-no-params.d.ts +0 -1
- package/dist/targets/javascript/axios/fixtures/multipart-form-data-no-params.js +0 -19
- package/dist/targets/javascript/axios/fixtures/multipart-form-data.d.ts +0 -1
- package/dist/targets/javascript/axios/fixtures/multipart-form-data.js +0 -22
- package/dist/targets/javascript/axios/fixtures/nested.d.ts +0 -1
- package/dist/targets/javascript/axios/fixtures/nested.js +0 -19
- package/dist/targets/javascript/axios/fixtures/postdata-malformed.d.ts +0 -1
- package/dist/targets/javascript/axios/fixtures/postdata-malformed.js +0 -19
- package/dist/targets/javascript/axios/fixtures/query-encoded.d.ts +0 -1
- package/dist/targets/javascript/axios/fixtures/query-encoded.js +0 -22
- package/dist/targets/javascript/axios/fixtures/query.d.ts +0 -1
- package/dist/targets/javascript/axios/fixtures/query.js +0 -19
- package/dist/targets/javascript/axios/fixtures/short.d.ts +0 -1
- package/dist/targets/javascript/axios/fixtures/short.js +0 -15
- package/dist/targets/javascript/axios/fixtures/text-plain.d.ts +0 -1
- package/dist/targets/javascript/axios/fixtures/text-plain.js +0 -20
- package/dist/targets/javascript/fetch/client.d.ts +0 -15
- package/dist/targets/javascript/fetch/client.js +0 -106
- package/dist/targets/javascript/fetch/fixtures/application-form-encoded.d.ts +0 -8
- package/dist/targets/javascript/fetch/fixtures/application-form-encoded.js +0 -10
- package/dist/targets/javascript/fetch/fixtures/application-json.d.ts +0 -7
- package/dist/targets/javascript/fetch/fixtures/application-json.js +0 -17
- package/dist/targets/javascript/fetch/fixtures/cookies.d.ts +0 -6
- package/dist/targets/javascript/fetch/fixtures/cookies.js +0 -6
- package/dist/targets/javascript/fetch/fixtures/custom-method.d.ts +0 -3
- package/dist/targets/javascript/fetch/fixtures/custom-method.js +0 -6
- package/dist/targets/javascript/fetch/fixtures/full.d.ts +0 -10
- package/dist/targets/javascript/fetch/fixtures/full.js +0 -14
- package/dist/targets/javascript/fetch/fixtures/headers.d.ts +0 -9
- package/dist/targets/javascript/fetch/fixtures/headers.js +0 -14
- package/dist/targets/javascript/fetch/fixtures/http-insecure.d.ts +0 -3
- package/dist/targets/javascript/fetch/fixtures/http-insecure.js +0 -6
- package/dist/targets/javascript/fetch/fixtures/jsonObj-multiline.d.ts +0 -7
- package/dist/targets/javascript/fetch/fixtures/jsonObj-multiline.js +0 -10
- package/dist/targets/javascript/fetch/fixtures/jsonObj-null-value.d.ts +0 -7
- package/dist/targets/javascript/fetch/fixtures/jsonObj-null-value.js +0 -10
- package/dist/targets/javascript/fetch/fixtures/multipart-data.d.ts +0 -4
- package/dist/targets/javascript/fetch/fixtures/multipart-data.js +0 -10
- package/dist/targets/javascript/fetch/fixtures/multipart-file.d.ts +0 -4
- package/dist/targets/javascript/fetch/fixtures/multipart-file.js +0 -9
- package/dist/targets/javascript/fetch/fixtures/multipart-form-data-no-params.d.ts +0 -6
- package/dist/targets/javascript/fetch/fixtures/multipart-form-data-no-params.js +0 -6
- package/dist/targets/javascript/fetch/fixtures/multipart-form-data.d.ts +0 -4
- package/dist/targets/javascript/fetch/fixtures/multipart-form-data.js +0 -9
- package/dist/targets/javascript/fetch/fixtures/nested.d.ts +0 -3
- package/dist/targets/javascript/fetch/fixtures/nested.js +0 -6
- package/dist/targets/javascript/fetch/fixtures/postdata-malformed.d.ts +0 -6
- package/dist/targets/javascript/fetch/fixtures/postdata-malformed.js +0 -6
- package/dist/targets/javascript/fetch/fixtures/query-encoded.d.ts +0 -3
- package/dist/targets/javascript/fetch/fixtures/query-encoded.js +0 -6
- package/dist/targets/javascript/fetch/fixtures/query.d.ts +0 -3
- package/dist/targets/javascript/fetch/fixtures/query.js +0 -6
- package/dist/targets/javascript/fetch/fixtures/short.d.ts +0 -3
- package/dist/targets/javascript/fetch/fixtures/short.js +0 -6
- package/dist/targets/javascript/fetch/fixtures/text-plain.d.ts +0 -7
- package/dist/targets/javascript/fetch/fixtures/text-plain.js +0 -6
- package/dist/targets/javascript/jquery/client.d.ts +0 -11
- package/dist/targets/javascript/jquery/client.js +0 -84
- package/dist/targets/javascript/jquery/fixtures/application-form-encoded.d.ts +0 -13
- package/dist/targets/javascript/jquery/fixtures/application-form-encoded.js +0 -17
- package/dist/targets/javascript/jquery/fixtures/application-json.d.ts +0 -11
- package/dist/targets/javascript/jquery/fixtures/application-json.js +0 -15
- package/dist/targets/javascript/jquery/fixtures/cookies.d.ts +0 -9
- package/dist/targets/javascript/jquery/fixtures/cookies.js +0 -13
- package/dist/targets/javascript/jquery/fixtures/custom-method.d.ts +0 -7
- package/dist/targets/javascript/jquery/fixtures/custom-method.js +0 -11
- package/dist/targets/javascript/jquery/fixtures/full.d.ts +0 -14
- package/dist/targets/javascript/jquery/fixtures/full.js +0 -18
- package/dist/targets/javascript/jquery/fixtures/headers.d.ts +0 -12
- package/dist/targets/javascript/jquery/fixtures/headers.js +0 -16
- package/dist/targets/javascript/jquery/fixtures/http-insecure.d.ts +0 -7
- package/dist/targets/javascript/jquery/fixtures/http-insecure.js +0 -11
- package/dist/targets/javascript/jquery/fixtures/jsonObj-multiline.d.ts +0 -11
- package/dist/targets/javascript/jquery/fixtures/jsonObj-multiline.js +0 -15
- package/dist/targets/javascript/jquery/fixtures/jsonObj-null-value.d.ts +0 -11
- package/dist/targets/javascript/jquery/fixtures/jsonObj-null-value.js +0 -15
- package/dist/targets/javascript/jquery/fixtures/multipart-data.d.ts +0 -12
- package/dist/targets/javascript/jquery/fixtures/multipart-data.js +0 -18
- package/dist/targets/javascript/jquery/fixtures/multipart-file.d.ts +0 -12
- package/dist/targets/javascript/jquery/fixtures/multipart-file.js +0 -17
- package/dist/targets/javascript/jquery/fixtures/multipart-form-data-no-params.d.ts +0 -9
- package/dist/targets/javascript/jquery/fixtures/multipart-form-data-no-params.js +0 -13
- package/dist/targets/javascript/jquery/fixtures/multipart-form-data.d.ts +0 -12
- package/dist/targets/javascript/jquery/fixtures/multipart-form-data.js +0 -17
- package/dist/targets/javascript/jquery/fixtures/nested.d.ts +0 -7
- package/dist/targets/javascript/jquery/fixtures/nested.js +0 -11
- package/dist/targets/javascript/jquery/fixtures/postdata-malformed.d.ts +0 -9
- package/dist/targets/javascript/jquery/fixtures/postdata-malformed.js +0 -13
- package/dist/targets/javascript/jquery/fixtures/query-encoded.d.ts +0 -7
- package/dist/targets/javascript/jquery/fixtures/query-encoded.js +0 -11
- package/dist/targets/javascript/jquery/fixtures/query.d.ts +0 -7
- package/dist/targets/javascript/jquery/fixtures/query.js +0 -11
- package/dist/targets/javascript/jquery/fixtures/short.d.ts +0 -7
- package/dist/targets/javascript/jquery/fixtures/short.js +0 -11
- package/dist/targets/javascript/jquery/fixtures/text-plain.d.ts +0 -10
- package/dist/targets/javascript/jquery/fixtures/text-plain.js +0 -14
- package/dist/targets/javascript/target.d.ts +0 -2
- package/dist/targets/javascript/target.js +0 -21
- package/dist/targets/javascript/xhr/client.d.ts +0 -14
- package/dist/targets/javascript/xhr/client.js +0 -83
- package/dist/targets/javascript/xhr/fixtures/application-form-encoded.d.ts +0 -2
- package/dist/targets/javascript/xhr/fixtures/application-form-encoded.js +0 -12
- package/dist/targets/javascript/xhr/fixtures/application-json.d.ts +0 -2
- package/dist/targets/javascript/xhr/fixtures/application-json.js +0 -31
- package/dist/targets/javascript/xhr/fixtures/cookies.d.ts +0 -2
- package/dist/targets/javascript/xhr/fixtures/cookies.js +0 -12
- package/dist/targets/javascript/xhr/fixtures/cors.d.ts +0 -2
- package/dist/targets/javascript/xhr/fixtures/cors.js +0 -10
- package/dist/targets/javascript/xhr/fixtures/custom-method.d.ts +0 -2
- package/dist/targets/javascript/xhr/fixtures/custom-method.js +0 -11
- package/dist/targets/javascript/xhr/fixtures/full.d.ts +0 -2
- package/dist/targets/javascript/xhr/fixtures/full.js +0 -14
- package/dist/targets/javascript/xhr/fixtures/headers.d.ts +0 -2
- package/dist/targets/javascript/xhr/fixtures/headers.js +0 -15
- package/dist/targets/javascript/xhr/fixtures/http-insecure.d.ts +0 -2
- package/dist/targets/javascript/xhr/fixtures/http-insecure.js +0 -11
- package/dist/targets/javascript/xhr/fixtures/jsonObj-multiline.d.ts +0 -2
- package/dist/targets/javascript/xhr/fixtures/jsonObj-multiline.js +0 -14
- package/dist/targets/javascript/xhr/fixtures/jsonObj-null-value.d.ts +0 -2
- package/dist/targets/javascript/xhr/fixtures/jsonObj-null-value.js +0 -14
- package/dist/targets/javascript/xhr/fixtures/multipart-data.d.ts +0 -2
- package/dist/targets/javascript/xhr/fixtures/multipart-data.js +0 -13
- package/dist/targets/javascript/xhr/fixtures/multipart-file.d.ts +0 -2
- package/dist/targets/javascript/xhr/fixtures/multipart-file.js +0 -12
- package/dist/targets/javascript/xhr/fixtures/multipart-form-data-no-params.d.ts +0 -1
- package/dist/targets/javascript/xhr/fixtures/multipart-form-data-no-params.js +0 -11
- package/dist/targets/javascript/xhr/fixtures/multipart-form-data.d.ts +0 -2
- package/dist/targets/javascript/xhr/fixtures/multipart-form-data.js +0 -12
- package/dist/targets/javascript/xhr/fixtures/nested.d.ts +0 -2
- package/dist/targets/javascript/xhr/fixtures/nested.js +0 -11
- package/dist/targets/javascript/xhr/fixtures/postdata-malformed.d.ts +0 -2
- package/dist/targets/javascript/xhr/fixtures/postdata-malformed.js +0 -12
- package/dist/targets/javascript/xhr/fixtures/query-encoded.d.ts +0 -2
- package/dist/targets/javascript/xhr/fixtures/query-encoded.js +0 -11
- package/dist/targets/javascript/xhr/fixtures/query.d.ts +0 -2
- package/dist/targets/javascript/xhr/fixtures/query.js +0 -11
- package/dist/targets/javascript/xhr/fixtures/short.d.ts +0 -2
- package/dist/targets/javascript/xhr/fixtures/short.js +0 -11
- package/dist/targets/javascript/xhr/fixtures/text-plain.d.ts +0 -2
- package/dist/targets/javascript/xhr/fixtures/text-plain.js +0 -12
- package/dist/targets/json/native/client.d.ts +0 -2
- package/dist/targets/json/native/client.js +0 -56
- package/dist/targets/json/target.d.ts +0 -2
- package/dist/targets/json/target.js +0 -15
- package/dist/targets/kotlin/okhttp/client.d.ts +0 -11
- package/dist/targets/kotlin/okhttp/client.js +0 -71
- package/dist/targets/kotlin/target.d.ts +0 -2
- package/dist/targets/kotlin/target.js +0 -15
- package/dist/targets/node/axios/client.d.ts +0 -11
- package/dist/targets/node/axios/client.js +0 -78
- package/dist/targets/node/axios/fixtures/application-form-encoded.d.ts +0 -1
- package/dist/targets/node/axios/fixtures/application-form-encoded.js +0 -20
- package/dist/targets/node/axios/fixtures/application-json.d.ts +0 -1
- package/dist/targets/node/axios/fixtures/application-json.js +0 -23
- package/dist/targets/node/axios/fixtures/cookies.d.ts +0 -1
- package/dist/targets/node/axios/fixtures/cookies.js +0 -15
- package/dist/targets/node/axios/fixtures/custom-method.d.ts +0 -1
- package/dist/targets/node/axios/fixtures/custom-method.js +0 -11
- package/dist/targets/node/axios/fixtures/full.d.ts +0 -1
- package/dist/targets/node/axios/fixtures/full.js +0 -23
- package/dist/targets/node/axios/fixtures/headers.d.ts +0 -1
- package/dist/targets/node/axios/fixtures/headers.js +0 -20
- package/dist/targets/node/axios/fixtures/http-insecure.d.ts +0 -1
- package/dist/targets/node/axios/fixtures/http-insecure.js +0 -11
- package/dist/targets/node/axios/fixtures/jsonObj-multiline.d.ts +0 -1
- package/dist/targets/node/axios/fixtures/jsonObj-multiline.js +0 -16
- package/dist/targets/node/axios/fixtures/jsonObj-null-value.d.ts +0 -1
- package/dist/targets/node/axios/fixtures/jsonObj-null-value.js +0 -16
- package/dist/targets/node/axios/fixtures/multipart-data.d.ts +0 -1
- package/dist/targets/node/axios/fixtures/multipart-data.js +0 -16
- package/dist/targets/node/axios/fixtures/multipart-file.d.ts +0 -1
- package/dist/targets/node/axios/fixtures/multipart-file.js +0 -16
- package/dist/targets/node/axios/fixtures/multipart-form-data-no-params.d.ts +0 -1
- package/dist/targets/node/axios/fixtures/multipart-form-data-no-params.js +0 -15
- package/dist/targets/node/axios/fixtures/multipart-form-data.d.ts +0 -1
- package/dist/targets/node/axios/fixtures/multipart-form-data.js +0 -16
- package/dist/targets/node/axios/fixtures/nested.d.ts +0 -1
- package/dist/targets/node/axios/fixtures/nested.js +0 -14
- package/dist/targets/node/axios/fixtures/postdata-malformed.d.ts +0 -1
- package/dist/targets/node/axios/fixtures/postdata-malformed.js +0 -15
- package/dist/targets/node/axios/fixtures/query-encoded.d.ts +0 -1
- package/dist/targets/node/axios/fixtures/query-encoded.js +0 -14
- package/dist/targets/node/axios/fixtures/query.d.ts +0 -1
- package/dist/targets/node/axios/fixtures/query.js +0 -14
- package/dist/targets/node/axios/fixtures/short.d.ts +0 -1
- package/dist/targets/node/axios/fixtures/short.js +0 -11
- package/dist/targets/node/axios/fixtures/text-plain.d.ts +0 -1
- package/dist/targets/node/axios/fixtures/text-plain.js +0 -16
- package/dist/targets/node/fetch/client.d.ts +0 -11
- package/dist/targets/node/fetch/client.js +0 -140
- package/dist/targets/node/fetch/fixtures/application-form-encoded.d.ts +0 -1
- package/dist/targets/node/fetch/fixtures/application-form-encoded.js +0 -16
- package/dist/targets/node/fetch/fixtures/application-json.d.ts +0 -1
- package/dist/targets/node/fetch/fixtures/application-json.js +0 -19
- package/dist/targets/node/fetch/fixtures/cookies.d.ts +0 -1
- package/dist/targets/node/fetch/fixtures/cookies.js +0 -8
- package/dist/targets/node/fetch/fixtures/custom-method.d.ts +0 -1
- package/dist/targets/node/fetch/fixtures/custom-method.js +0 -8
- package/dist/targets/node/fetch/fixtures/full.d.ts +0 -1
- package/dist/targets/node/fetch/fixtures/full.js +0 -19
- package/dist/targets/node/fetch/fixtures/headers.d.ts +0 -1
- package/dist/targets/node/fetch/fixtures/headers.js +0 -16
- package/dist/targets/node/fetch/fixtures/http-insecure.d.ts +0 -1
- package/dist/targets/node/fetch/fixtures/http-insecure.js +0 -8
- package/dist/targets/node/fetch/fixtures/jsonObj-multiline.d.ts +0 -1
- package/dist/targets/node/fetch/fixtures/jsonObj-multiline.js +0 -12
- package/dist/targets/node/fetch/fixtures/jsonObj-null-value.d.ts +0 -1
- package/dist/targets/node/fetch/fixtures/jsonObj-null-value.js +0 -12
- package/dist/targets/node/fetch/fixtures/multipart-data.d.ts +0 -1
- package/dist/targets/node/fetch/fixtures/multipart-data.js +0 -14
- package/dist/targets/node/fetch/fixtures/multipart-file.d.ts +0 -1
- package/dist/targets/node/fetch/fixtures/multipart-file.js +0 -13
- package/dist/targets/node/fetch/fixtures/multipart-form-data-no-params.d.ts +0 -1
- package/dist/targets/node/fetch/fixtures/multipart-form-data-no-params.js +0 -8
- package/dist/targets/node/fetch/fixtures/multipart-form-data.d.ts +0 -1
- package/dist/targets/node/fetch/fixtures/multipart-form-data.js +0 -12
- package/dist/targets/node/fetch/fixtures/nested.d.ts +0 -1
- package/dist/targets/node/fetch/fixtures/nested.js +0 -8
- package/dist/targets/node/fetch/fixtures/postdata-malformed.d.ts +0 -1
- package/dist/targets/node/fetch/fixtures/postdata-malformed.js +0 -8
- package/dist/targets/node/fetch/fixtures/query-encoded.d.ts +0 -1
- package/dist/targets/node/fetch/fixtures/query-encoded.js +0 -8
- package/dist/targets/node/fetch/fixtures/query.d.ts +0 -1
- package/dist/targets/node/fetch/fixtures/query.js +0 -8
- package/dist/targets/node/fetch/fixtures/short.d.ts +0 -1
- package/dist/targets/node/fetch/fixtures/short.js +0 -8
- package/dist/targets/node/fetch/fixtures/text-plain.d.ts +0 -1
- package/dist/targets/node/fetch/fixtures/text-plain.js +0 -8
- package/dist/targets/node/native/client.d.ts +0 -11
- package/dist/targets/node/native/client.js +0 -72
- package/dist/targets/node/native/fixtures/application-form-encoded.d.ts +0 -1
- package/dist/targets/node/native/fixtures/application-form-encoded.js +0 -24
- package/dist/targets/node/native/fixtures/application-json.d.ts +0 -1
- package/dist/targets/node/native/fixtures/application-json.js +0 -30
- package/dist/targets/node/native/fixtures/cookies.d.ts +0 -1
- package/dist/targets/node/native/fixtures/cookies.js +0 -22
- package/dist/targets/node/native/fixtures/custom-method.d.ts +0 -1
- package/dist/targets/node/native/fixtures/custom-method.js +0 -20
- package/dist/targets/node/native/fixtures/full.d.ts +0 -1
- package/dist/targets/node/native/fixtures/full.js +0 -26
- package/dist/targets/node/native/fixtures/headers.d.ts +0 -1
- package/dist/targets/node/native/fixtures/headers.js +0 -25
- package/dist/targets/node/native/fixtures/http-insecure.d.ts +0 -1
- package/dist/targets/node/native/fixtures/http-insecure.js +0 -20
- package/dist/targets/node/native/fixtures/jsonObj-multiline.d.ts +0 -1
- package/dist/targets/node/native/fixtures/jsonObj-multiline.js +0 -23
- package/dist/targets/node/native/fixtures/jsonObj-null-value.d.ts +0 -1
- package/dist/targets/node/native/fixtures/jsonObj-null-value.js +0 -23
- package/dist/targets/node/native/fixtures/multipart-data.d.ts +0 -1
- package/dist/targets/node/native/fixtures/multipart-data.js +0 -23
- package/dist/targets/node/native/fixtures/multipart-file.d.ts +0 -1
- package/dist/targets/node/native/fixtures/multipart-file.js +0 -23
- package/dist/targets/node/native/fixtures/multipart-form-data-no-params.d.ts +0 -1
- package/dist/targets/node/native/fixtures/multipart-form-data-no-params.js +0 -22
- package/dist/targets/node/native/fixtures/multipart-form-data.d.ts +0 -1
- package/dist/targets/node/native/fixtures/multipart-form-data.js +0 -23
- package/dist/targets/node/native/fixtures/nested.d.ts +0 -1
- package/dist/targets/node/native/fixtures/nested.js +0 -20
- package/dist/targets/node/native/fixtures/postdata-malformed.d.ts +0 -1
- package/dist/targets/node/native/fixtures/postdata-malformed.js +0 -22
- package/dist/targets/node/native/fixtures/query-encoded.d.ts +0 -1
- package/dist/targets/node/native/fixtures/query-encoded.js +0 -20
- package/dist/targets/node/native/fixtures/query.d.ts +0 -1
- package/dist/targets/node/native/fixtures/query.js +0 -20
- package/dist/targets/node/native/fixtures/short.d.ts +0 -1
- package/dist/targets/node/native/fixtures/short.js +0 -20
- package/dist/targets/node/native/fixtures/text-plain.d.ts +0 -1
- package/dist/targets/node/native/fixtures/text-plain.js +0 -23
- package/dist/targets/node/request/client.d.ts +0 -11
- package/dist/targets/node/request/client.js +0 -107
- package/dist/targets/node/request/fixtures/application-form-encoded.d.ts +0 -1
- package/dist/targets/node/request/fixtures/application-form-encoded.js +0 -13
- package/dist/targets/node/request/fixtures/application-json.d.ts +0 -1
- package/dist/targets/node/request/fixtures/application-json.js +0 -21
- package/dist/targets/node/request/fixtures/cookies.d.ts +0 -1
- package/dist/targets/node/request/fixtures/cookies.js +0 -11
- package/dist/targets/node/request/fixtures/custom-method.d.ts +0 -1
- package/dist/targets/node/request/fixtures/custom-method.js +0 -8
- package/dist/targets/node/request/fixtures/full.d.ts +0 -1
- package/dist/targets/node/request/fixtures/full.js +0 -20
- package/dist/targets/node/request/fixtures/headers.d.ts +0 -1
- package/dist/targets/node/request/fixtures/headers.js +0 -17
- package/dist/targets/node/request/fixtures/http-insecure.d.ts +0 -1
- package/dist/targets/node/request/fixtures/http-insecure.js +0 -8
- package/dist/targets/node/request/fixtures/jsonObj-multiline.d.ts +0 -1
- package/dist/targets/node/request/fixtures/jsonObj-multiline.js +0 -14
- package/dist/targets/node/request/fixtures/jsonObj-null-value.d.ts +0 -1
- package/dist/targets/node/request/fixtures/jsonObj-null-value.js +0 -14
- package/dist/targets/node/request/fixtures/multipart-data.d.ts +0 -1
- package/dist/targets/node/request/fixtures/multipart-data.js +0 -20
- package/dist/targets/node/request/fixtures/multipart-file.d.ts +0 -1
- package/dist/targets/node/request/fixtures/multipart-file.js +0 -19
- package/dist/targets/node/request/fixtures/multipart-form-data-no-params.d.ts +0 -1
- package/dist/targets/node/request/fixtures/multipart-form-data-no-params.js +0 -12
- package/dist/targets/node/request/fixtures/multipart-form-data.d.ts +0 -1
- package/dist/targets/node/request/fixtures/multipart-form-data.js +0 -13
- package/dist/targets/node/request/fixtures/nested.d.ts +0 -1
- package/dist/targets/node/request/fixtures/nested.js +0 -11
- package/dist/targets/node/request/fixtures/postdata-malformed.d.ts +0 -1
- package/dist/targets/node/request/fixtures/postdata-malformed.js +0 -12
- package/dist/targets/node/request/fixtures/query-encoded.d.ts +0 -1
- package/dist/targets/node/request/fixtures/query-encoded.js +0 -11
- package/dist/targets/node/request/fixtures/query.d.ts +0 -1
- package/dist/targets/node/request/fixtures/query.js +0 -11
- package/dist/targets/node/request/fixtures/short.d.ts +0 -1
- package/dist/targets/node/request/fixtures/short.js +0 -8
- package/dist/targets/node/request/fixtures/text-plain.d.ts +0 -1
- package/dist/targets/node/request/fixtures/text-plain.js +0 -13
- package/dist/targets/node/target.d.ts +0 -2
- package/dist/targets/node/target.js +0 -24
- package/dist/targets/node/unirest/client.d.ts +0 -11
- package/dist/targets/node/unirest/client.js +0 -110
- package/dist/targets/node/unirest/fixtures/application-form-encoded.d.ts +0 -1
- package/dist/targets/node/unirest/fixtures/application-form-encoded.js +0 -15
- package/dist/targets/node/unirest/fixtures/application-json.d.ts +0 -1
- package/dist/targets/node/unirest/fixtures/application-json.js +0 -32
- package/dist/targets/node/unirest/fixtures/cookies.d.ts +0 -1
- package/dist/targets/node/unirest/fixtures/cookies.js +0 -12
- package/dist/targets/node/unirest/fixtures/custom-method.d.ts +0 -1
- package/dist/targets/node/unirest/fixtures/custom-method.js +0 -8
- package/dist/targets/node/unirest/fixtures/full.d.ts +0 -1
- package/dist/targets/node/unirest/fixtures/full.js +0 -27
- package/dist/targets/node/unirest/fixtures/headers.d.ts +0 -1
- package/dist/targets/node/unirest/fixtures/headers.js +0 -14
- package/dist/targets/node/unirest/fixtures/http-insecure.d.ts +0 -1
- package/dist/targets/node/unirest/fixtures/http-insecure.js +0 -8
- package/dist/targets/node/unirest/fixtures/jsonObj-multiline.d.ts +0 -1
- package/dist/targets/node/unirest/fixtures/jsonObj-multiline.js +0 -15
- package/dist/targets/node/unirest/fixtures/jsonObj-null-value.d.ts +0 -1
- package/dist/targets/node/unirest/fixtures/jsonObj-null-value.js +0 -15
- package/dist/targets/node/unirest/fixtures/multipart-data.d.ts +0 -1
- package/dist/targets/node/unirest/fixtures/multipart-data.js +0 -20
- package/dist/targets/node/unirest/fixtures/multipart-file.d.ts +0 -1
- package/dist/targets/node/unirest/fixtures/multipart-file.js +0 -18
- package/dist/targets/node/unirest/fixtures/multipart-form-data-no-params.d.ts +0 -1
- package/dist/targets/node/unirest/fixtures/multipart-form-data-no-params.js +0 -11
- package/dist/targets/node/unirest/fixtures/multipart-form-data.d.ts +0 -1
- package/dist/targets/node/unirest/fixtures/multipart-form-data.js +0 -16
- package/dist/targets/node/unirest/fixtures/nested.d.ts +0 -1
- package/dist/targets/node/unirest/fixtures/nested.js +0 -13
- package/dist/targets/node/unirest/fixtures/postdata-malformed.d.ts +0 -1
- package/dist/targets/node/unirest/fixtures/postdata-malformed.js +0 -11
- package/dist/targets/node/unirest/fixtures/query-encoded.d.ts +0 -1
- package/dist/targets/node/unirest/fixtures/query-encoded.js +0 -12
- package/dist/targets/node/unirest/fixtures/query.d.ts +0 -1
- package/dist/targets/node/unirest/fixtures/query.js +0 -16
- package/dist/targets/node/unirest/fixtures/short.d.ts +0 -1
- package/dist/targets/node/unirest/fixtures/short.js +0 -8
- package/dist/targets/node/unirest/fixtures/text-plain.d.ts +0 -1
- package/dist/targets/node/unirest/fixtures/text-plain.js +0 -12
- package/dist/targets/objc/helpers.d.ts +0 -26
- package/dist/targets/objc/helpers.js +0 -59
- package/dist/targets/objc/nsurlsession/client.d.ts +0 -15
- package/dist/targets/objc/nsurlsession/client.js +0 -143
- package/dist/targets/objc/target.d.ts +0 -2
- package/dist/targets/objc/target.js +0 -15
- package/dist/targets/ocaml/cohttp/client.d.ts +0 -11
- package/dist/targets/ocaml/cohttp/client.js +0 -64
- package/dist/targets/ocaml/target.d.ts +0 -2
- package/dist/targets/ocaml/target.js +0 -15
- package/dist/targets/php/curl/client.d.ts +0 -19
- package/dist/targets/php/curl/client.js +0 -122
- package/dist/targets/php/guzzle/client.d.ts +0 -17
- package/dist/targets/php/guzzle/client.js +0 -119
- package/dist/targets/php/helpers.d.ts +0 -2
- package/dist/targets/php/helpers.js +0 -66
- package/dist/targets/php/http1/client.d.ts +0 -16
- package/dist/targets/php/http1/client.js +0 -76
- package/dist/targets/php/http2/client.d.ts +0 -16
- package/dist/targets/php/http2/client.js +0 -115
- package/dist/targets/php/target.d.ts +0 -2
- package/dist/targets/php/target.js +0 -22
- package/dist/targets/powershell/common.d.ts +0 -3
- package/dist/targets/powershell/common.js +0 -50
- package/dist/targets/powershell/restmethod/client.d.ts +0 -2
- package/dist/targets/powershell/restmethod/client.js +0 -13
- package/dist/targets/powershell/target.d.ts +0 -2
- package/dist/targets/powershell/target.js +0 -17
- package/dist/targets/powershell/webrequest/client.d.ts +0 -2
- package/dist/targets/powershell/webrequest/client.js +0 -13
- package/dist/targets/python/helpers.d.ts +0 -8
- package/dist/targets/python/helpers.js +0 -64
- package/dist/targets/python/requests/client.d.ts +0 -14
- package/dist/targets/python/requests/client.js +0 -162
- package/dist/targets/python/target.d.ts +0 -2
- package/dist/targets/python/target.js +0 -16
- package/dist/targets/r/httr/client.d.ts +0 -11
- package/dist/targets/r/httr/client.js +0 -130
- package/dist/targets/r/target.d.ts +0 -2
- package/dist/targets/r/target.js +0 -15
- package/dist/targets/ruby/native/client.d.ts +0 -2
- package/dist/targets/ruby/native/client.js +0 -67
- package/dist/targets/ruby/target.d.ts +0 -2
- package/dist/targets/ruby/target.js +0 -15
- package/dist/targets/shell/curl/client.d.ts +0 -19
- package/dist/targets/shell/curl/client.js +0 -166
- package/dist/targets/shell/httpie/client.d.ts +0 -24
- package/dist/targets/shell/httpie/client.js +0 -102
- package/dist/targets/shell/target.d.ts +0 -2
- package/dist/targets/shell/target.js +0 -20
- package/dist/targets/shell/wget/client.d.ts +0 -16
- package/dist/targets/shell/wget/client.js +0 -46
- package/dist/targets/swift/helpers.d.ts +0 -16
- package/dist/targets/swift/helpers.js +0 -80
- package/dist/targets/swift/nsurlsession/client.d.ts +0 -15
- package/dist/targets/swift/nsurlsession/client.js +0 -148
- package/dist/targets/swift/target.d.ts +0 -2
- package/dist/targets/swift/target.js +0 -15
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var unirest = require('unirest');
|
|
3
|
-
var req = unirest('POST', 'https://httpbin.org/anything');
|
|
4
|
-
req.headers({
|
|
5
|
-
'content-type': 'application/json'
|
|
6
|
-
});
|
|
7
|
-
req.type('json');
|
|
8
|
-
req.send({
|
|
9
|
-
number: 1,
|
|
10
|
-
string: 'f"oo',
|
|
11
|
-
arr: [
|
|
12
|
-
1,
|
|
13
|
-
2,
|
|
14
|
-
3
|
|
15
|
-
],
|
|
16
|
-
nested: {
|
|
17
|
-
a: 'b'
|
|
18
|
-
},
|
|
19
|
-
arr_mix: [
|
|
20
|
-
1,
|
|
21
|
-
'a',
|
|
22
|
-
{
|
|
23
|
-
arr_mix_nested: []
|
|
24
|
-
}
|
|
25
|
-
],
|
|
26
|
-
boolean: false
|
|
27
|
-
});
|
|
28
|
-
req.end(function (res) {
|
|
29
|
-
if (res.error)
|
|
30
|
-
throw new Error(res.error);
|
|
31
|
-
console.log(res.body);
|
|
32
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var unirest = require('unirest');
|
|
3
|
-
var req = unirest('GET', 'https://httpbin.org/cookies');
|
|
4
|
-
var CookieJar = unirest.jar();
|
|
5
|
-
CookieJar.add('foo=bar', 'https://httpbin.org/cookies');
|
|
6
|
-
CookieJar.add('bar=baz', 'https://httpbin.org/cookies');
|
|
7
|
-
req.jar(CookieJar);
|
|
8
|
-
req.end(function (res) {
|
|
9
|
-
if (res.error)
|
|
10
|
-
throw new Error(res.error);
|
|
11
|
-
console.log(res.body);
|
|
12
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var unirest = require('unirest');
|
|
3
|
-
var req = unirest('POST', 'https://httpbin.org/anything');
|
|
4
|
-
var CookieJar = unirest.jar();
|
|
5
|
-
CookieJar.add('foo=bar', 'https://httpbin.org/anything');
|
|
6
|
-
CookieJar.add('bar=baz', 'https://httpbin.org/anything');
|
|
7
|
-
req.jar(CookieJar);
|
|
8
|
-
req.query({
|
|
9
|
-
foo: [
|
|
10
|
-
'bar',
|
|
11
|
-
'baz'
|
|
12
|
-
],
|
|
13
|
-
baz: 'abc',
|
|
14
|
-
key: 'value'
|
|
15
|
-
});
|
|
16
|
-
req.headers({
|
|
17
|
-
accept: 'application/json',
|
|
18
|
-
'content-type': 'application/x-www-form-urlencoded'
|
|
19
|
-
});
|
|
20
|
-
req.form({
|
|
21
|
-
foo: 'bar'
|
|
22
|
-
});
|
|
23
|
-
req.end(function (res) {
|
|
24
|
-
if (res.error)
|
|
25
|
-
throw new Error(res.error);
|
|
26
|
-
console.log(res.body);
|
|
27
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var unirest = require('unirest');
|
|
3
|
-
var req = unirest('GET', 'https://httpbin.org/headers');
|
|
4
|
-
req.headers({
|
|
5
|
-
accept: 'application/json',
|
|
6
|
-
'x-foo': 'Bar',
|
|
7
|
-
'x-bar': 'Foo',
|
|
8
|
-
'quoted-value': '"quoted" \'string\''
|
|
9
|
-
});
|
|
10
|
-
req.end(function (res) {
|
|
11
|
-
if (res.error)
|
|
12
|
-
throw new Error(res.error);
|
|
13
|
-
console.log(res.body);
|
|
14
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var unirest = require('unirest');
|
|
3
|
-
var req = unirest('POST', 'https://httpbin.org/anything');
|
|
4
|
-
req.headers({
|
|
5
|
-
'content-type': 'application/json'
|
|
6
|
-
});
|
|
7
|
-
req.type('json');
|
|
8
|
-
req.send({
|
|
9
|
-
foo: 'bar'
|
|
10
|
-
});
|
|
11
|
-
req.end(function (res) {
|
|
12
|
-
if (res.error)
|
|
13
|
-
throw new Error(res.error);
|
|
14
|
-
console.log(res.body);
|
|
15
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var unirest = require('unirest');
|
|
3
|
-
var req = unirest('POST', 'https://httpbin.org/anything');
|
|
4
|
-
req.headers({
|
|
5
|
-
'content-type': 'application/json'
|
|
6
|
-
});
|
|
7
|
-
req.type('json');
|
|
8
|
-
req.send({
|
|
9
|
-
foo: null
|
|
10
|
-
});
|
|
11
|
-
req.end(function (res) {
|
|
12
|
-
if (res.error)
|
|
13
|
-
throw new Error(res.error);
|
|
14
|
-
console.log(res.body);
|
|
15
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var unirest = require('unirest');
|
|
3
|
-
var req = unirest('POST', 'https://httpbin.org/anything');
|
|
4
|
-
req.headers({
|
|
5
|
-
'content-type': 'multipart/form-data; boundary=---011000010111000001101001'
|
|
6
|
-
});
|
|
7
|
-
req.multipart([
|
|
8
|
-
{
|
|
9
|
-
body: 'Hello World',
|
|
10
|
-
'content-type': 'text/plain'
|
|
11
|
-
},
|
|
12
|
-
{
|
|
13
|
-
body: 'Bonjour le monde'
|
|
14
|
-
}
|
|
15
|
-
]);
|
|
16
|
-
req.end(function (res) {
|
|
17
|
-
if (res.error)
|
|
18
|
-
throw new Error(res.error);
|
|
19
|
-
console.log(res.body);
|
|
20
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var fs = require('fs');
|
|
3
|
-
var unirest = require('unirest');
|
|
4
|
-
var req = unirest('POST', 'https://httpbin.org/anything');
|
|
5
|
-
req.headers({
|
|
6
|
-
'content-type': 'multipart/form-data; boundary=---011000010111000001101001'
|
|
7
|
-
});
|
|
8
|
-
req.multipart([
|
|
9
|
-
{
|
|
10
|
-
body: fs.createReadStream('src/fixtures/files/hello.txt'),
|
|
11
|
-
'content-type': 'text/plain'
|
|
12
|
-
}
|
|
13
|
-
]);
|
|
14
|
-
req.end(function (res) {
|
|
15
|
-
if (res.error)
|
|
16
|
-
throw new Error(res.error);
|
|
17
|
-
console.log(res.body);
|
|
18
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var unirest = require('unirest');
|
|
3
|
-
var req = unirest('POST', 'https://httpbin.org/anything');
|
|
4
|
-
req.headers({
|
|
5
|
-
'Content-Type': 'multipart/form-data'
|
|
6
|
-
});
|
|
7
|
-
req.end(function (res) {
|
|
8
|
-
if (res.error)
|
|
9
|
-
throw new Error(res.error);
|
|
10
|
-
console.log(res.body);
|
|
11
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var unirest = require('unirest');
|
|
3
|
-
var req = unirest('POST', 'https://httpbin.org/anything');
|
|
4
|
-
req.headers({
|
|
5
|
-
'Content-Type': 'multipart/form-data; boundary=---011000010111000001101001'
|
|
6
|
-
});
|
|
7
|
-
req.multipart([
|
|
8
|
-
{
|
|
9
|
-
body: 'bar'
|
|
10
|
-
}
|
|
11
|
-
]);
|
|
12
|
-
req.end(function (res) {
|
|
13
|
-
if (res.error)
|
|
14
|
-
throw new Error(res.error);
|
|
15
|
-
console.log(res.body);
|
|
16
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var unirest = require('unirest');
|
|
3
|
-
var req = unirest('GET', 'https://httpbin.org/anything');
|
|
4
|
-
req.query({
|
|
5
|
-
'foo[bar]': 'baz,zap',
|
|
6
|
-
fiz: 'buz',
|
|
7
|
-
key: 'value'
|
|
8
|
-
});
|
|
9
|
-
req.end(function (res) {
|
|
10
|
-
if (res.error)
|
|
11
|
-
throw new Error(res.error);
|
|
12
|
-
console.log(res.body);
|
|
13
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var unirest = require('unirest');
|
|
3
|
-
var req = unirest('POST', 'https://httpbin.org/anything');
|
|
4
|
-
req.headers({
|
|
5
|
-
'content-type': 'application/json'
|
|
6
|
-
});
|
|
7
|
-
req.end(function (res) {
|
|
8
|
-
if (res.error)
|
|
9
|
-
throw new Error(res.error);
|
|
10
|
-
console.log(res.body);
|
|
11
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var unirest = require('unirest');
|
|
3
|
-
var req = unirest('GET', 'https://httpbin.org/anything');
|
|
4
|
-
req.query({
|
|
5
|
-
startTime: '2019-06-13T19%3A08%3A25.455Z',
|
|
6
|
-
endTime: '2015-09-15T14%3A00%3A12-04%3A00'
|
|
7
|
-
});
|
|
8
|
-
req.end(function (res) {
|
|
9
|
-
if (res.error)
|
|
10
|
-
throw new Error(res.error);
|
|
11
|
-
console.log(res.body);
|
|
12
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var unirest = require('unirest');
|
|
3
|
-
var req = unirest('GET', 'https://httpbin.org/anything');
|
|
4
|
-
req.query({
|
|
5
|
-
foo: [
|
|
6
|
-
'bar',
|
|
7
|
-
'baz'
|
|
8
|
-
],
|
|
9
|
-
baz: 'abc',
|
|
10
|
-
key: 'value'
|
|
11
|
-
});
|
|
12
|
-
req.end(function (res) {
|
|
13
|
-
if (res.error)
|
|
14
|
-
throw new Error(res.error);
|
|
15
|
-
console.log(res.body);
|
|
16
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var unirest = require('unirest');
|
|
3
|
-
var req = unirest('POST', 'https://httpbin.org/anything');
|
|
4
|
-
req.headers({
|
|
5
|
-
'content-type': 'text/plain'
|
|
6
|
-
});
|
|
7
|
-
req.send('Hello World');
|
|
8
|
-
req.end(function (res) {
|
|
9
|
-
if (res.error)
|
|
10
|
-
throw new Error(res.error);
|
|
11
|
-
console.log(res.body);
|
|
12
|
-
});
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Create a string corresponding to a valid declaration and initialization of an Objective-C object literal.
|
|
3
|
-
*
|
|
4
|
-
* @param nsClass Class of the litteral
|
|
5
|
-
* @param name Desired name of the instance
|
|
6
|
-
* @param parameters Key-value object of parameters to translate to an Objective-C object litearal
|
|
7
|
-
* @param indent If true, will declare the litteral by indenting each new key/value pair.
|
|
8
|
-
* @return A valid Objective-C declaration and initialization of an Objective-C object litteral.
|
|
9
|
-
*
|
|
10
|
-
* @example
|
|
11
|
-
* nsDeclaration('NSDictionary', 'params', {a: 'b', c: 'd'}, true)
|
|
12
|
-
* // returns:
|
|
13
|
-
* NSDictionary *params = @{ @"a": @"b",
|
|
14
|
-
* @"c": @"d" };
|
|
15
|
-
*
|
|
16
|
-
* nsDeclaration('NSDictionary', 'params', {a: 'b', c: 'd'})
|
|
17
|
-
* // returns:
|
|
18
|
-
* NSDictionary *params = @{ @"a": @"b", @"c": @"d" };
|
|
19
|
-
*/
|
|
20
|
-
export declare const nsDeclaration: (nsClass: string, name: string, parameters: Record<string, any>, indent?: boolean) => string;
|
|
21
|
-
/**
|
|
22
|
-
* Create a valid Objective-C string of a literal value according to its type.
|
|
23
|
-
*
|
|
24
|
-
* @param value Any JavaScript literal
|
|
25
|
-
*/
|
|
26
|
-
export declare const literalRepresentation: (value: any, indentation?: number) => string;
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.literalRepresentation = exports.nsDeclaration = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* Create a string corresponding to a valid declaration and initialization of an Objective-C object literal.
|
|
6
|
-
*
|
|
7
|
-
* @param nsClass Class of the litteral
|
|
8
|
-
* @param name Desired name of the instance
|
|
9
|
-
* @param parameters Key-value object of parameters to translate to an Objective-C object litearal
|
|
10
|
-
* @param indent If true, will declare the litteral by indenting each new key/value pair.
|
|
11
|
-
* @return A valid Objective-C declaration and initialization of an Objective-C object litteral.
|
|
12
|
-
*
|
|
13
|
-
* @example
|
|
14
|
-
* nsDeclaration('NSDictionary', 'params', {a: 'b', c: 'd'}, true)
|
|
15
|
-
* // returns:
|
|
16
|
-
* NSDictionary *params = @{ @"a": @"b",
|
|
17
|
-
* @"c": @"d" };
|
|
18
|
-
*
|
|
19
|
-
* nsDeclaration('NSDictionary', 'params', {a: 'b', c: 'd'})
|
|
20
|
-
* // returns:
|
|
21
|
-
* NSDictionary *params = @{ @"a": @"b", @"c": @"d" };
|
|
22
|
-
*/
|
|
23
|
-
var nsDeclaration = function (nsClass, name, parameters, indent) {
|
|
24
|
-
var opening = "".concat(nsClass, " *").concat(name, " = ");
|
|
25
|
-
var literal = (0, exports.literalRepresentation)(parameters, indent ? opening.length : undefined);
|
|
26
|
-
return "".concat(opening).concat(literal, ";");
|
|
27
|
-
};
|
|
28
|
-
exports.nsDeclaration = nsDeclaration;
|
|
29
|
-
/**
|
|
30
|
-
* Create a valid Objective-C string of a literal value according to its type.
|
|
31
|
-
*
|
|
32
|
-
* @param value Any JavaScript literal
|
|
33
|
-
*/
|
|
34
|
-
var literalRepresentation = function (value, indentation) {
|
|
35
|
-
var join = indentation === undefined ? ', ' : ",\n ".concat(' '.repeat(indentation));
|
|
36
|
-
switch (Object.prototype.toString.call(value)) {
|
|
37
|
-
case '[object Number]':
|
|
38
|
-
return "@".concat(value);
|
|
39
|
-
case '[object Array]': {
|
|
40
|
-
var valuesRepresentation = value.map(function (val) { return (0, exports.literalRepresentation)(val); });
|
|
41
|
-
return "@[ ".concat(valuesRepresentation.join(join), " ]");
|
|
42
|
-
}
|
|
43
|
-
case '[object Object]': {
|
|
44
|
-
var keyValuePairs_1 = [];
|
|
45
|
-
Object.keys(value).forEach(function (key) {
|
|
46
|
-
keyValuePairs_1.push("@\"".concat(key, "\": ").concat((0, exports.literalRepresentation)(value[key])));
|
|
47
|
-
});
|
|
48
|
-
return "@{ ".concat(keyValuePairs_1.join(join), " }");
|
|
49
|
-
}
|
|
50
|
-
case '[object Boolean]':
|
|
51
|
-
return value ? '@YES' : '@NO';
|
|
52
|
-
default:
|
|
53
|
-
if (value === null || value === undefined) {
|
|
54
|
-
return '';
|
|
55
|
-
}
|
|
56
|
-
return "@\"".concat(value.toString().replace(/"/g, '\\"'), "\"");
|
|
57
|
-
}
|
|
58
|
-
};
|
|
59
|
-
exports.literalRepresentation = literalRepresentation;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @description
|
|
3
|
-
* HTTP code snippet generator for Objective-C using NSURLSession.
|
|
4
|
-
*
|
|
5
|
-
* @author
|
|
6
|
-
* @thibaultCha
|
|
7
|
-
*
|
|
8
|
-
* for any questions or issues regarding the generated code snippet, please open an issue mentioning the author.
|
|
9
|
-
*/
|
|
10
|
-
import type { Client } from '../../targets';
|
|
11
|
-
export interface NsurlsessionOptions {
|
|
12
|
-
pretty?: boolean;
|
|
13
|
-
timeout?: number;
|
|
14
|
-
}
|
|
15
|
-
export declare const nsurlsession: Client<NsurlsessionOptions>;
|
|
@@ -1,143 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
|
-
var __read = (this && this.__read) || function (o, n) {
|
|
14
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
15
|
-
if (!m) return o;
|
|
16
|
-
var i = m.call(o), r, ar = [], e;
|
|
17
|
-
try {
|
|
18
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
19
|
-
}
|
|
20
|
-
catch (error) { e = { error: error }; }
|
|
21
|
-
finally {
|
|
22
|
-
try {
|
|
23
|
-
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
24
|
-
}
|
|
25
|
-
finally { if (e) throw e.error; }
|
|
26
|
-
}
|
|
27
|
-
return ar;
|
|
28
|
-
};
|
|
29
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30
|
-
exports.nsurlsession = void 0;
|
|
31
|
-
var code_builder_1 = require("../../../helpers/code-builder");
|
|
32
|
-
var helpers_1 = require("../helpers");
|
|
33
|
-
exports.nsurlsession = {
|
|
34
|
-
info: {
|
|
35
|
-
key: 'nsurlsession',
|
|
36
|
-
title: 'NSURLSession',
|
|
37
|
-
link: 'https://developer.apple.com/library/mac/documentation/Foundation/Reference/NSURLSession_class/index.html',
|
|
38
|
-
description: "Foundation's NSURLSession request",
|
|
39
|
-
},
|
|
40
|
-
convert: function (_a, options) {
|
|
41
|
-
var _b;
|
|
42
|
-
var allHeaders = _a.allHeaders, postData = _a.postData, method = _a.method, fullUrl = _a.fullUrl;
|
|
43
|
-
var opts = __assign({ indent: ' ', pretty: true, timeout: 10 }, options);
|
|
44
|
-
var _c = new code_builder_1.CodeBuilder({ indent: opts.indent }), push = _c.push, join = _c.join, blank = _c.blank;
|
|
45
|
-
// Markers for headers to be created as literal objects and later be set on the NSURLRequest if exist
|
|
46
|
-
var req = {
|
|
47
|
-
hasHeaders: false,
|
|
48
|
-
hasBody: false,
|
|
49
|
-
};
|
|
50
|
-
// We just want to make sure people understand that is the only dependency
|
|
51
|
-
push('#import <Foundation/Foundation.h>');
|
|
52
|
-
if (Object.keys(allHeaders).length) {
|
|
53
|
-
req.hasHeaders = true;
|
|
54
|
-
blank();
|
|
55
|
-
push((0, helpers_1.nsDeclaration)('NSDictionary', 'headers', allHeaders, opts.pretty));
|
|
56
|
-
}
|
|
57
|
-
if (postData.text || postData.jsonObj || postData.params) {
|
|
58
|
-
req.hasBody = true;
|
|
59
|
-
switch (postData.mimeType) {
|
|
60
|
-
case 'application/x-www-form-urlencoded':
|
|
61
|
-
if ((_b = postData.params) === null || _b === void 0 ? void 0 : _b.length) {
|
|
62
|
-
// By appending parameters one by one in the resulting snippet,
|
|
63
|
-
// we make it easier for the user to edit it according to his or her needs after pasting.
|
|
64
|
-
// The user can just add/remove lines adding/removing body parameters.
|
|
65
|
-
blank();
|
|
66
|
-
var _d = __read(postData.params), head = _d[0], tail = _d.slice(1);
|
|
67
|
-
push("NSMutableData *postData = [[NSMutableData alloc] initWithData:[@\"".concat(head.name, "=").concat(head.value, "\" dataUsingEncoding:NSUTF8StringEncoding]];"));
|
|
68
|
-
tail.forEach(function (_a) {
|
|
69
|
-
var name = _a.name, value = _a.value;
|
|
70
|
-
push("[postData appendData:[@\"&".concat(name, "=").concat(value, "\" dataUsingEncoding:NSUTF8StringEncoding]];"));
|
|
71
|
-
});
|
|
72
|
-
}
|
|
73
|
-
else {
|
|
74
|
-
req.hasBody = false;
|
|
75
|
-
}
|
|
76
|
-
break;
|
|
77
|
-
case 'application/json':
|
|
78
|
-
if (postData.jsonObj) {
|
|
79
|
-
push((0, helpers_1.nsDeclaration)('NSDictionary', 'parameters', postData.jsonObj, opts.pretty));
|
|
80
|
-
blank();
|
|
81
|
-
push('NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];');
|
|
82
|
-
}
|
|
83
|
-
break;
|
|
84
|
-
case 'multipart/form-data':
|
|
85
|
-
// By appending multipart parameters one by one in the resulting snippet,
|
|
86
|
-
// we make it easier for the user to edit it according to his or her needs after pasting.
|
|
87
|
-
// The user can just edit the parameters NSDictionary or put this part of a snippet in a multipart builder method.
|
|
88
|
-
push((0, helpers_1.nsDeclaration)('NSArray', 'parameters', postData.params || [], opts.pretty));
|
|
89
|
-
push("NSString *boundary = @\"".concat(postData.boundary, "\";"));
|
|
90
|
-
blank();
|
|
91
|
-
push('NSError *error;');
|
|
92
|
-
push('NSMutableString *body = [NSMutableString string];');
|
|
93
|
-
push('for (NSDictionary *param in parameters) {');
|
|
94
|
-
push('[body appendFormat:@"--%@\\r\\n", boundary];', 1);
|
|
95
|
-
push('if (param[@"fileName"]) {', 1);
|
|
96
|
-
push('[body appendFormat:@"Content-Disposition:form-data; name=\\"%@\\"; filename=\\"%@\\"\\r\\n", param[@"name"], param[@"fileName"]];', 2);
|
|
97
|
-
push('[body appendFormat:@"Content-Type: %@\\r\\n\\r\\n", param[@"contentType"]];', 2);
|
|
98
|
-
push('[body appendFormat:@"%@", [NSString stringWithContentsOfFile:param[@"fileName"] encoding:NSUTF8StringEncoding error:&error]];', 2);
|
|
99
|
-
push('if (error) {', 2);
|
|
100
|
-
push('NSLog(@"%@", error);', 3);
|
|
101
|
-
push('}', 2);
|
|
102
|
-
push('} else {', 1);
|
|
103
|
-
push('[body appendFormat:@"Content-Disposition:form-data; name=\\"%@\\"\\r\\n\\r\\n", param[@"name"]];', 2);
|
|
104
|
-
push('[body appendFormat:@"%@", param[@"value"]];', 2);
|
|
105
|
-
push('}', 1);
|
|
106
|
-
push('}');
|
|
107
|
-
push('[body appendFormat:@"\\r\\n--%@--\\r\\n", boundary];');
|
|
108
|
-
push('NSData *postData = [body dataUsingEncoding:NSUTF8StringEncoding];');
|
|
109
|
-
break;
|
|
110
|
-
default:
|
|
111
|
-
blank();
|
|
112
|
-
push("NSData *postData = [[NSData alloc] initWithData:[@\"".concat(postData.text, "\" dataUsingEncoding:NSUTF8StringEncoding]];"));
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
blank();
|
|
116
|
-
push("NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@\"".concat(fullUrl, "\"]"));
|
|
117
|
-
// NSURLRequestUseProtocolCachePolicy is the default policy, let's just always set it to avoid confusion.
|
|
118
|
-
push(' cachePolicy:NSURLRequestUseProtocolCachePolicy');
|
|
119
|
-
push(" timeoutInterval:".concat(opts.timeout.toFixed(1), "];"));
|
|
120
|
-
push("[request setHTTPMethod:@\"".concat(method, "\"];"));
|
|
121
|
-
if (req.hasHeaders) {
|
|
122
|
-
push('[request setAllHTTPHeaderFields:headers];');
|
|
123
|
-
}
|
|
124
|
-
if (req.hasBody) {
|
|
125
|
-
push('[request setHTTPBody:postData];');
|
|
126
|
-
}
|
|
127
|
-
blank();
|
|
128
|
-
// Retrieving the shared session will be less verbose than creating a new one.
|
|
129
|
-
push('NSURLSession *session = [NSURLSession sharedSession];');
|
|
130
|
-
push('NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request');
|
|
131
|
-
push(' completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {');
|
|
132
|
-
push(' if (error) {', 1);
|
|
133
|
-
push(' NSLog(@"%@", error);', 2);
|
|
134
|
-
push(' } else {', 1);
|
|
135
|
-
// Casting the NSURLResponse to NSHTTPURLResponse so the user can see the status .
|
|
136
|
-
push(' NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;', 2);
|
|
137
|
-
push(' NSLog(@"%@", httpResponse);', 2);
|
|
138
|
-
push(' }', 1);
|
|
139
|
-
push(' }];');
|
|
140
|
-
push('[dataTask resume];');
|
|
141
|
-
return join();
|
|
142
|
-
},
|
|
143
|
-
};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.objc = void 0;
|
|
4
|
-
var client_1 = require("./nsurlsession/client");
|
|
5
|
-
exports.objc = {
|
|
6
|
-
info: {
|
|
7
|
-
key: 'objc',
|
|
8
|
-
title: 'Objective-C',
|
|
9
|
-
extname: '.m',
|
|
10
|
-
default: 'nsurlsession',
|
|
11
|
-
},
|
|
12
|
-
clientsById: {
|
|
13
|
-
nsurlsession: client_1.nsurlsession,
|
|
14
|
-
},
|
|
15
|
-
};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @description
|
|
3
|
-
* HTTP code snippet generator for OCaml using CoHTTP.
|
|
4
|
-
*
|
|
5
|
-
* @author
|
|
6
|
-
* @SGrondin
|
|
7
|
-
*
|
|
8
|
-
* for any questions or issues regarding the generated code snippet, please open an issue mentioning the author.
|
|
9
|
-
*/
|
|
10
|
-
import type { Client } from '../../targets';
|
|
11
|
-
export declare const cohttp: Client;
|