@readme/httpsnippet 6.2.1 → 7.0.0
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 +30 -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,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
var axios_1 = __importDefault(require("axios"));
|
|
7
|
-
var options = {
|
|
8
|
-
method: 'POST',
|
|
9
|
-
url: 'https://httpbin.org/anything',
|
|
10
|
-
headers: { 'content-type': 'application/json' },
|
|
11
|
-
data: {
|
|
12
|
-
number: 1,
|
|
13
|
-
string: 'f"oo',
|
|
14
|
-
arr: [1, 2, 3],
|
|
15
|
-
nested: { a: 'b' },
|
|
16
|
-
arr_mix: [1, 'a', { arr_mix_nested: [] }],
|
|
17
|
-
boolean: false
|
|
18
|
-
}
|
|
19
|
-
};
|
|
20
|
-
axios_1.default
|
|
21
|
-
.request(options)
|
|
22
|
-
.then(function (response) {
|
|
23
|
-
console.log(response.data);
|
|
24
|
-
})
|
|
25
|
-
.catch(function (error) {
|
|
26
|
-
console.error(error);
|
|
27
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
var axios_1 = __importDefault(require("axios"));
|
|
7
|
-
var options = {
|
|
8
|
-
method: 'GET',
|
|
9
|
-
url: 'https://httpbin.org/cookies',
|
|
10
|
-
headers: { cookie: 'foo=bar; bar=baz' }
|
|
11
|
-
};
|
|
12
|
-
axios_1.default
|
|
13
|
-
.request(options)
|
|
14
|
-
.then(function (response) {
|
|
15
|
-
console.log(response.data);
|
|
16
|
-
})
|
|
17
|
-
.catch(function (error) {
|
|
18
|
-
console.error(error);
|
|
19
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
var axios_1 = __importDefault(require("axios"));
|
|
7
|
-
var options = { method: 'PROPFIND', url: 'https://httpbin.org/anything' };
|
|
8
|
-
axios_1.default
|
|
9
|
-
.request(options)
|
|
10
|
-
.then(function (response) {
|
|
11
|
-
console.log(response.data);
|
|
12
|
-
})
|
|
13
|
-
.catch(function (error) {
|
|
14
|
-
console.error(error);
|
|
15
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
var axios_1 = __importDefault(require("axios"));
|
|
7
|
-
var encodedParams = new URLSearchParams();
|
|
8
|
-
encodedParams.set('foo', 'bar');
|
|
9
|
-
var options = {
|
|
10
|
-
method: 'POST',
|
|
11
|
-
url: 'https://httpbin.org/anything',
|
|
12
|
-
params: { foo: ['bar', 'baz'], baz: 'abc', key: 'value' },
|
|
13
|
-
headers: {
|
|
14
|
-
cookie: 'foo=bar; bar=baz',
|
|
15
|
-
accept: 'application/json',
|
|
16
|
-
'content-type': 'application/x-www-form-urlencoded'
|
|
17
|
-
},
|
|
18
|
-
data: encodedParams,
|
|
19
|
-
};
|
|
20
|
-
axios_1.default
|
|
21
|
-
.request(options)
|
|
22
|
-
.then(function (response) {
|
|
23
|
-
console.log(response.data);
|
|
24
|
-
})
|
|
25
|
-
.catch(function (error) {
|
|
26
|
-
console.error(error);
|
|
27
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
var axios_1 = __importDefault(require("axios"));
|
|
7
|
-
var options = {
|
|
8
|
-
method: 'GET',
|
|
9
|
-
url: 'https://httpbin.org/headers',
|
|
10
|
-
headers: {
|
|
11
|
-
accept: 'application/json',
|
|
12
|
-
'x-foo': 'Bar',
|
|
13
|
-
'x-bar': 'Foo',
|
|
14
|
-
'quoted-value': '"quoted" \'string\''
|
|
15
|
-
}
|
|
16
|
-
};
|
|
17
|
-
axios_1.default
|
|
18
|
-
.request(options)
|
|
19
|
-
.then(function (response) {
|
|
20
|
-
console.log(response.data);
|
|
21
|
-
})
|
|
22
|
-
.catch(function (error) {
|
|
23
|
-
console.error(error);
|
|
24
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
var axios_1 = __importDefault(require("axios"));
|
|
7
|
-
var options = { method: 'GET', url: 'http://httpbin.org/anything' };
|
|
8
|
-
axios_1.default
|
|
9
|
-
.request(options)
|
|
10
|
-
.then(function (response) {
|
|
11
|
-
console.log(response.data);
|
|
12
|
-
})
|
|
13
|
-
.catch(function (error) {
|
|
14
|
-
console.error(error);
|
|
15
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
var axios_1 = __importDefault(require("axios"));
|
|
7
|
-
var options = {
|
|
8
|
-
method: 'POST',
|
|
9
|
-
url: 'https://httpbin.org/anything',
|
|
10
|
-
headers: { 'content-type': 'application/json' },
|
|
11
|
-
data: { foo: 'bar' }
|
|
12
|
-
};
|
|
13
|
-
axios_1.default
|
|
14
|
-
.request(options)
|
|
15
|
-
.then(function (response) {
|
|
16
|
-
console.log(response.data);
|
|
17
|
-
})
|
|
18
|
-
.catch(function (error) {
|
|
19
|
-
console.error(error);
|
|
20
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
var axios_1 = __importDefault(require("axios"));
|
|
7
|
-
var options = {
|
|
8
|
-
method: 'POST',
|
|
9
|
-
url: 'https://httpbin.org/anything',
|
|
10
|
-
headers: { 'content-type': 'application/json' },
|
|
11
|
-
data: { foo: null }
|
|
12
|
-
};
|
|
13
|
-
axios_1.default
|
|
14
|
-
.request(options)
|
|
15
|
-
.then(function (response) {
|
|
16
|
-
console.log(response.data);
|
|
17
|
-
})
|
|
18
|
-
.catch(function (error) {
|
|
19
|
-
console.error(error);
|
|
20
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
var axios_1 = __importDefault(require("axios"));
|
|
7
|
-
var form = new FormData();
|
|
8
|
-
form.append('foo', 'Hello World');
|
|
9
|
-
form.append('bar', 'Bonjour le monde');
|
|
10
|
-
var options = {
|
|
11
|
-
method: 'POST',
|
|
12
|
-
url: 'https://httpbin.org/anything',
|
|
13
|
-
headers: { 'content-type': 'multipart/form-data; boundary=---011000010111000001101001' },
|
|
14
|
-
data: '[form]'
|
|
15
|
-
};
|
|
16
|
-
axios_1.default
|
|
17
|
-
.request(options)
|
|
18
|
-
.then(function (response) {
|
|
19
|
-
console.log(response.data);
|
|
20
|
-
})
|
|
21
|
-
.catch(function (error) {
|
|
22
|
-
console.error(error);
|
|
23
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
var axios_1 = __importDefault(require("axios"));
|
|
7
|
-
var form = new FormData();
|
|
8
|
-
form.append('foo', 'src/fixtures/files/hello.txt');
|
|
9
|
-
var options = {
|
|
10
|
-
method: 'POST',
|
|
11
|
-
url: 'https://httpbin.org/anything',
|
|
12
|
-
headers: { 'content-type': 'multipart/form-data; boundary=---011000010111000001101001' },
|
|
13
|
-
data: '[form]'
|
|
14
|
-
};
|
|
15
|
-
axios_1.default
|
|
16
|
-
.request(options)
|
|
17
|
-
.then(function (response) {
|
|
18
|
-
console.log(response.data);
|
|
19
|
-
})
|
|
20
|
-
.catch(function (error) {
|
|
21
|
-
console.error(error);
|
|
22
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
var axios_1 = __importDefault(require("axios"));
|
|
7
|
-
var options = {
|
|
8
|
-
method: 'POST',
|
|
9
|
-
url: 'https://httpbin.org/anything',
|
|
10
|
-
headers: { 'Content-Type': 'multipart/form-data' }
|
|
11
|
-
};
|
|
12
|
-
axios_1.default
|
|
13
|
-
.request(options)
|
|
14
|
-
.then(function (response) {
|
|
15
|
-
console.log(response.data);
|
|
16
|
-
})
|
|
17
|
-
.catch(function (error) {
|
|
18
|
-
console.error(error);
|
|
19
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
var axios_1 = __importDefault(require("axios"));
|
|
7
|
-
var form = new FormData();
|
|
8
|
-
form.append('foo', 'bar');
|
|
9
|
-
var options = {
|
|
10
|
-
method: 'POST',
|
|
11
|
-
url: 'https://httpbin.org/anything',
|
|
12
|
-
headers: { 'Content-Type': 'multipart/form-data; boundary=---011000010111000001101001' },
|
|
13
|
-
data: '[form]'
|
|
14
|
-
};
|
|
15
|
-
axios_1.default
|
|
16
|
-
.request(options)
|
|
17
|
-
.then(function (response) {
|
|
18
|
-
console.log(response.data);
|
|
19
|
-
})
|
|
20
|
-
.catch(function (error) {
|
|
21
|
-
console.error(error);
|
|
22
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
var axios_1 = __importDefault(require("axios"));
|
|
7
|
-
var options = {
|
|
8
|
-
method: 'GET',
|
|
9
|
-
url: 'https://httpbin.org/anything',
|
|
10
|
-
params: { 'foo[bar]': 'baz,zap', fiz: 'buz', key: 'value' }
|
|
11
|
-
};
|
|
12
|
-
axios_1.default
|
|
13
|
-
.request(options)
|
|
14
|
-
.then(function (response) {
|
|
15
|
-
console.log(response.data);
|
|
16
|
-
})
|
|
17
|
-
.catch(function (error) {
|
|
18
|
-
console.error(error);
|
|
19
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
var axios_1 = __importDefault(require("axios"));
|
|
7
|
-
var options = {
|
|
8
|
-
method: 'POST',
|
|
9
|
-
url: 'https://httpbin.org/anything',
|
|
10
|
-
headers: { 'content-type': 'application/json' }
|
|
11
|
-
};
|
|
12
|
-
axios_1.default
|
|
13
|
-
.request(options)
|
|
14
|
-
.then(function (response) {
|
|
15
|
-
console.log(response.data);
|
|
16
|
-
})
|
|
17
|
-
.catch(function (error) {
|
|
18
|
-
console.error(error);
|
|
19
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
var axios_1 = __importDefault(require("axios"));
|
|
7
|
-
var options = {
|
|
8
|
-
method: 'GET',
|
|
9
|
-
url: 'https://httpbin.org/anything',
|
|
10
|
-
params: {
|
|
11
|
-
startTime: '2019-06-13T19%3A08%3A25.455Z',
|
|
12
|
-
endTime: '2015-09-15T14%3A00%3A12-04%3A00'
|
|
13
|
-
}
|
|
14
|
-
};
|
|
15
|
-
axios_1.default
|
|
16
|
-
.request(options)
|
|
17
|
-
.then(function (response) {
|
|
18
|
-
console.log(response.data);
|
|
19
|
-
})
|
|
20
|
-
.catch(function (error) {
|
|
21
|
-
console.error(error);
|
|
22
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
var axios_1 = __importDefault(require("axios"));
|
|
7
|
-
var options = {
|
|
8
|
-
method: 'GET',
|
|
9
|
-
url: 'https://httpbin.org/anything',
|
|
10
|
-
params: { foo: ['bar', 'baz'], baz: 'abc', key: 'value' }
|
|
11
|
-
};
|
|
12
|
-
axios_1.default
|
|
13
|
-
.request(options)
|
|
14
|
-
.then(function (response) {
|
|
15
|
-
console.log(response.data);
|
|
16
|
-
})
|
|
17
|
-
.catch(function (error) {
|
|
18
|
-
console.error(error);
|
|
19
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
var axios_1 = __importDefault(require("axios"));
|
|
7
|
-
var options = { method: 'GET', url: 'https://httpbin.org/anything' };
|
|
8
|
-
axios_1.default
|
|
9
|
-
.request(options)
|
|
10
|
-
.then(function (response) {
|
|
11
|
-
console.log(response.data);
|
|
12
|
-
})
|
|
13
|
-
.catch(function (error) {
|
|
14
|
-
console.error(error);
|
|
15
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
var axios_1 = __importDefault(require("axios"));
|
|
7
|
-
var options = {
|
|
8
|
-
method: 'POST',
|
|
9
|
-
url: 'https://httpbin.org/anything',
|
|
10
|
-
headers: { 'content-type': 'text/plain' },
|
|
11
|
-
data: 'Hello World'
|
|
12
|
-
};
|
|
13
|
-
axios_1.default
|
|
14
|
-
.request(options)
|
|
15
|
-
.then(function (response) {
|
|
16
|
-
console.log(response.data);
|
|
17
|
-
})
|
|
18
|
-
.catch(function (error) {
|
|
19
|
-
console.error(error);
|
|
20
|
-
});
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @description
|
|
3
|
-
* HTTP code snippet generator for fetch
|
|
4
|
-
*
|
|
5
|
-
* @author
|
|
6
|
-
* @pmdroid
|
|
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
|
-
interface FetchOptions {
|
|
12
|
-
credentials?: Record<string, string> | null;
|
|
13
|
-
}
|
|
14
|
-
export declare const fetch: Client<FetchOptions>;
|
|
15
|
-
export {};
|
|
@@ -1,106 +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 __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.fetch = void 0;
|
|
18
|
-
var stringify_object_1 = __importDefault(require("stringify-object"));
|
|
19
|
-
var code_builder_1 = require("../../../helpers/code-builder");
|
|
20
|
-
var headers_1 = require("../../../helpers/headers");
|
|
21
|
-
exports.fetch = {
|
|
22
|
-
info: {
|
|
23
|
-
key: 'fetch',
|
|
24
|
-
title: 'fetch',
|
|
25
|
-
link: 'https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch',
|
|
26
|
-
description: 'Perform asynchronous HTTP requests with the Fetch API',
|
|
27
|
-
},
|
|
28
|
-
convert: function (_a, inputOpts) {
|
|
29
|
-
var method = _a.method, allHeaders = _a.allHeaders, postData = _a.postData, fullUrl = _a.fullUrl;
|
|
30
|
-
var opts = __assign({ indent: ' ', credentials: null }, inputOpts);
|
|
31
|
-
var _b = new code_builder_1.CodeBuilder({ indent: opts.indent }), blank = _b.blank, join = _b.join, push = _b.push;
|
|
32
|
-
var options = {
|
|
33
|
-
method: method,
|
|
34
|
-
};
|
|
35
|
-
if (Object.keys(allHeaders).length) {
|
|
36
|
-
options.headers = allHeaders;
|
|
37
|
-
}
|
|
38
|
-
if (opts.credentials !== null) {
|
|
39
|
-
options.credentials = opts.credentials;
|
|
40
|
-
}
|
|
41
|
-
switch (postData.mimeType) {
|
|
42
|
-
case 'application/x-www-form-urlencoded':
|
|
43
|
-
options.body = postData.paramsObj ? postData.paramsObj : postData.text;
|
|
44
|
-
break;
|
|
45
|
-
case 'application/json':
|
|
46
|
-
if (postData.jsonObj) {
|
|
47
|
-
// Though `fetch` doesn't accept JSON objects in the `body` option we're going to
|
|
48
|
-
// stringify it when we add this into the snippet further down.
|
|
49
|
-
options.body = postData.jsonObj;
|
|
50
|
-
}
|
|
51
|
-
break;
|
|
52
|
-
case 'multipart/form-data':
|
|
53
|
-
if (!postData.params) {
|
|
54
|
-
break;
|
|
55
|
-
}
|
|
56
|
-
// The FormData API automatically adds a `Content-Type` header for `multipart/form-data` content and if we add our own here data won't be correctly transmitted.
|
|
57
|
-
// eslint-disable-next-line no-case-declarations -- We're only using `contentTypeHeader` within this block.
|
|
58
|
-
var contentTypeHeader = (0, headers_1.getHeaderName)(allHeaders, 'content-type');
|
|
59
|
-
if (contentTypeHeader) {
|
|
60
|
-
delete allHeaders[contentTypeHeader];
|
|
61
|
-
}
|
|
62
|
-
push('const form = new FormData();');
|
|
63
|
-
postData.params.forEach(function (param) {
|
|
64
|
-
push("form.append('".concat(param.name, "', '").concat(param.value || param.fileName || '', "');"));
|
|
65
|
-
});
|
|
66
|
-
blank();
|
|
67
|
-
break;
|
|
68
|
-
default:
|
|
69
|
-
if (postData.text) {
|
|
70
|
-
options.body = postData.text;
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
// If we ultimately don't have any headers to send then we shouldn't add an empty object into the request options.
|
|
74
|
-
if (options.headers && !Object.keys(options.headers).length) {
|
|
75
|
-
delete options.headers;
|
|
76
|
-
}
|
|
77
|
-
push("const options = ".concat((0, stringify_object_1.default)(options, {
|
|
78
|
-
indent: opts.indent,
|
|
79
|
-
inlineCharacterLimit: 80,
|
|
80
|
-
// The Fetch API body only accepts string parameters, but stringified JSON can be difficult
|
|
81
|
-
// to read, so we keep the object as a literal and use this transform function to wrap the
|
|
82
|
-
// literal in a `JSON.stringify` call.
|
|
83
|
-
transform: function (object, property, originalResult) {
|
|
84
|
-
if (property === 'body') {
|
|
85
|
-
if (postData.mimeType === 'application/x-www-form-urlencoded') {
|
|
86
|
-
return "new URLSearchParams(".concat(originalResult, ")");
|
|
87
|
-
}
|
|
88
|
-
else if (postData.mimeType === 'application/json') {
|
|
89
|
-
return "JSON.stringify(".concat(originalResult, ")");
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
return originalResult;
|
|
93
|
-
},
|
|
94
|
-
}), ";"));
|
|
95
|
-
blank();
|
|
96
|
-
if (postData.params && postData.mimeType === 'multipart/form-data') {
|
|
97
|
-
push('options.body = form;');
|
|
98
|
-
blank();
|
|
99
|
-
}
|
|
100
|
-
push("fetch('".concat(fullUrl, "', options)"));
|
|
101
|
-
push('.then(response => response.json())', 1);
|
|
102
|
-
push('.then(response => console.log(response))', 1);
|
|
103
|
-
push('.catch(err => console.error(err));', 1);
|
|
104
|
-
return join();
|
|
105
|
-
},
|
|
106
|
-
};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var options = {
|
|
3
|
-
method: 'POST',
|
|
4
|
-
headers: { 'content-type': 'application/x-www-form-urlencoded' },
|
|
5
|
-
body: new URLSearchParams({ foo: 'bar', hello: 'world' })
|
|
6
|
-
};
|
|
7
|
-
fetch('https://httpbin.org/anything', options)
|
|
8
|
-
.then(function (response) { return response.json(); })
|
|
9
|
-
.then(function (response) { return console.log(response); })
|
|
10
|
-
.catch(function (err) { return console.error(err); });
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var options = {
|
|
3
|
-
method: 'POST',
|
|
4
|
-
headers: { 'content-type': 'application/json' },
|
|
5
|
-
body: JSON.stringify({
|
|
6
|
-
number: 1,
|
|
7
|
-
string: 'f"oo',
|
|
8
|
-
arr: [1, 2, 3],
|
|
9
|
-
nested: { a: 'b' },
|
|
10
|
-
arr_mix: [1, 'a', { arr_mix_nested: [] }],
|
|
11
|
-
boolean: false
|
|
12
|
-
})
|
|
13
|
-
};
|
|
14
|
-
fetch('https://httpbin.org/anything', options)
|
|
15
|
-
.then(function (response) { return response.json(); })
|
|
16
|
-
.then(function (response) { return console.log(response); })
|
|
17
|
-
.catch(function (err) { return console.error(err); });
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var options = { method: 'GET', headers: { cookie: 'foo=bar; bar=baz' } };
|
|
3
|
-
fetch('https://httpbin.org/cookies', options)
|
|
4
|
-
.then(function (response) { return response.json(); })
|
|
5
|
-
.then(function (response) { return console.log(response); })
|
|
6
|
-
.catch(function (err) { return console.error(err); });
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var options = { method: 'PROPFIND' };
|
|
3
|
-
fetch('https://httpbin.org/anything', options)
|
|
4
|
-
.then(function (response) { return response.json(); })
|
|
5
|
-
.then(function (response) { return console.log(response); })
|
|
6
|
-
.catch(function (err) { return console.error(err); });
|