@readme/httpsnippet 4.0.1 → 4.0.2
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/package.json +86 -0
- package/dist/src/fixtures/customTarget.js +15 -0
- package/dist/src/fixtures/mimetypes.js +77 -0
- package/dist/src/fixtures/requests/application-form-encoded.js +69 -0
- package/dist/src/fixtures/requests/application-json.js +72 -0
- package/dist/src/fixtures/requests/cookies.js +51 -0
- package/dist/src/fixtures/requests/custom-method.js +41 -0
- package/dist/src/fixtures/requests/full.js +99 -0
- package/dist/src/fixtures/requests/headers.js +56 -0
- package/dist/src/fixtures/requests/http-insecure.js +45 -0
- package/dist/src/fixtures/requests/jsonObj-multiline.js +59 -0
- package/dist/src/fixtures/requests/jsonObj-null-value.js +61 -0
- package/dist/src/fixtures/requests/multipart-data.js +72 -0
- package/dist/src/fixtures/requests/multipart-file.js +65 -0
- package/dist/src/fixtures/requests/multipart-form-data-no-params.js +56 -0
- package/dist/src/fixtures/requests/multipart-form-data.js +64 -0
- package/dist/src/fixtures/requests/nested.js +64 -0
- package/dist/src/fixtures/requests/query-encoded.js +59 -0
- package/dist/src/fixtures/requests/query.js +64 -0
- package/dist/src/fixtures/requests/short.js +45 -0
- package/dist/src/fixtures/requests/text-plain.js +57 -0
- package/dist/src/fixtures/runCustomFixtures.js +77 -0
- package/dist/src/helpers/code-builder.js +91 -0
- package/dist/src/helpers/form-data.js +157 -0
- package/dist/src/helpers/har-validator.js +76 -0
- package/dist/src/helpers/headers.js +33 -0
- package/dist/src/helpers/reducer.js +19 -0
- package/dist/src/helpers/shell.js +20 -0
- package/dist/src/helpers/utils.js +21 -0
- package/dist/src/index.js +285 -0
- package/dist/src/targets/c/libcurl/client.js +43 -0
- package/dist/src/targets/c/target.js +15 -0
- package/dist/src/targets/clojure/clj_http/client.js +184 -0
- package/dist/src/targets/clojure/target.js +15 -0
- package/dist/src/targets/csharp/httpclient/client.js +162 -0
- package/dist/src/targets/csharp/restsharp/client.js +38 -0
- package/dist/src/targets/csharp/target.js +17 -0
- package/dist/src/targets/go/native/client.js +122 -0
- package/dist/src/targets/go/target.js +15 -0
- package/dist/src/targets/http/http1.1/client.js +79 -0
- package/dist/src/targets/http/target.js +15 -0
- package/dist/src/targets/java/asynchttp/client.js +53 -0
- package/dist/src/targets/java/nethttp/client.js +52 -0
- package/dist/src/targets/java/okhttp/client.js +79 -0
- package/dist/src/targets/java/target.js +21 -0
- package/dist/src/targets/java/unirest/client.js +53 -0
- package/dist/src/targets/javascript/axios/client.js +101 -0
- package/dist/src/targets/javascript/axios/fixtures/application-form-encoded.js +22 -0
- package/dist/src/targets/javascript/axios/fixtures/application-json.js +26 -0
- package/dist/src/targets/javascript/axios/fixtures/cookies.js +18 -0
- package/dist/src/targets/javascript/axios/fixtures/custom-method.js +14 -0
- package/dist/src/targets/javascript/axios/fixtures/full.js +26 -0
- package/dist/src/targets/javascript/axios/fixtures/headers.js +18 -0
- package/dist/src/targets/javascript/axios/fixtures/http-insecure.js +14 -0
- package/dist/src/targets/javascript/axios/fixtures/jsonObj-multiline.js +19 -0
- package/dist/src/targets/javascript/axios/fixtures/jsonObj-null-value.js +19 -0
- package/dist/src/targets/javascript/axios/fixtures/multipart-data.js +22 -0
- package/dist/src/targets/javascript/axios/fixtures/multipart-file.js +21 -0
- package/dist/src/targets/javascript/axios/fixtures/multipart-form-data-no-params.js +18 -0
- package/dist/src/targets/javascript/axios/fixtures/multipart-form-data.js +21 -0
- package/dist/src/targets/javascript/axios/fixtures/nested.js +18 -0
- package/dist/src/targets/javascript/axios/fixtures/query-encoded.js +21 -0
- package/dist/src/targets/javascript/axios/fixtures/query.js +18 -0
- package/dist/src/targets/javascript/axios/fixtures/short.js +14 -0
- package/dist/src/targets/javascript/axios/fixtures/text-plain.js +19 -0
- package/dist/src/targets/javascript/fetch/client.js +115 -0
- package/dist/src/targets/javascript/fetch/fixtures/application-form-encoded.js +9 -0
- package/dist/src/targets/javascript/fetch/fixtures/application-json.js +16 -0
- package/dist/src/targets/javascript/fetch/fixtures/cookies.js +5 -0
- package/dist/src/targets/javascript/fetch/fixtures/custom-method.js +5 -0
- package/dist/src/targets/javascript/fetch/fixtures/full.js +13 -0
- package/dist/src/targets/javascript/fetch/fixtures/headers.js +8 -0
- package/dist/src/targets/javascript/fetch/fixtures/http-insecure.js +5 -0
- package/dist/src/targets/javascript/fetch/fixtures/jsonObj-multiline.js +9 -0
- package/dist/src/targets/javascript/fetch/fixtures/jsonObj-null-value.js +9 -0
- package/dist/src/targets/javascript/fetch/fixtures/multipart-data.js +9 -0
- package/dist/src/targets/javascript/fetch/fixtures/multipart-file.js +8 -0
- package/dist/src/targets/javascript/fetch/fixtures/multipart-form-data-no-params.js +5 -0
- package/dist/src/targets/javascript/fetch/fixtures/multipart-form-data.js +8 -0
- package/dist/src/targets/javascript/fetch/fixtures/nested.js +5 -0
- package/dist/src/targets/javascript/fetch/fixtures/query-encoded.js +5 -0
- package/dist/src/targets/javascript/fetch/fixtures/query.js +5 -0
- package/dist/src/targets/javascript/fetch/fixtures/short.js +5 -0
- package/dist/src/targets/javascript/fetch/fixtures/text-plain.js +5 -0
- package/dist/src/targets/javascript/jquery/client.js +93 -0
- package/dist/src/targets/javascript/jquery/fixtures/application-form-encoded.js +17 -0
- package/dist/src/targets/javascript/jquery/fixtures/application-json.js +15 -0
- package/dist/src/targets/javascript/jquery/fixtures/cookies.js +13 -0
- package/dist/src/targets/javascript/jquery/fixtures/custom-method.js +11 -0
- package/dist/src/targets/javascript/jquery/fixtures/full.js +18 -0
- package/dist/src/targets/javascript/jquery/fixtures/headers.js +15 -0
- package/dist/src/targets/javascript/jquery/fixtures/http-insecure.js +11 -0
- package/dist/src/targets/javascript/jquery/fixtures/jsonObj-multiline.js +15 -0
- package/dist/src/targets/javascript/jquery/fixtures/jsonObj-null-value.js +15 -0
- package/dist/src/targets/javascript/jquery/fixtures/multipart-data.js +18 -0
- package/dist/src/targets/javascript/jquery/fixtures/multipart-file.js +17 -0
- package/dist/src/targets/javascript/jquery/fixtures/multipart-form-data-no-params.js +13 -0
- package/dist/src/targets/javascript/jquery/fixtures/multipart-form-data.js +17 -0
- package/dist/src/targets/javascript/jquery/fixtures/nested.js +11 -0
- package/dist/src/targets/javascript/jquery/fixtures/query-encoded.js +11 -0
- package/dist/src/targets/javascript/jquery/fixtures/query.js +11 -0
- package/dist/src/targets/javascript/jquery/fixtures/short.js +11 -0
- package/dist/src/targets/javascript/jquery/fixtures/text-plain.js +14 -0
- package/dist/src/targets/javascript/target.js +21 -0
- package/dist/src/targets/javascript/xhr/client.js +90 -0
- package/dist/src/targets/javascript/xhr/fixtures/application-form-encoded.js +12 -0
- package/dist/src/targets/javascript/xhr/fixtures/application-json.js +31 -0
- package/dist/src/targets/javascript/xhr/fixtures/cookies.js +12 -0
- package/dist/src/targets/javascript/xhr/fixtures/cors.js +10 -0
- package/dist/src/targets/javascript/xhr/fixtures/custom-method.js +11 -0
- package/dist/src/targets/javascript/xhr/fixtures/full.js +14 -0
- package/dist/src/targets/javascript/xhr/fixtures/headers.js +14 -0
- package/dist/src/targets/javascript/xhr/fixtures/http-insecure.js +11 -0
- package/dist/src/targets/javascript/xhr/fixtures/jsonObj-multiline.js +14 -0
- package/dist/src/targets/javascript/xhr/fixtures/jsonObj-null-value.js +14 -0
- package/dist/src/targets/javascript/xhr/fixtures/multipart-data.js +13 -0
- package/dist/src/targets/javascript/xhr/fixtures/multipart-file.js +12 -0
- package/dist/src/targets/javascript/xhr/fixtures/multipart-form-data-no-params.js +11 -0
- package/dist/src/targets/javascript/xhr/fixtures/multipart-form-data.js +12 -0
- package/dist/src/targets/javascript/xhr/fixtures/nested.js +11 -0
- package/dist/src/targets/javascript/xhr/fixtures/query-encoded.js +11 -0
- package/dist/src/targets/javascript/xhr/fixtures/query.js +11 -0
- package/dist/src/targets/javascript/xhr/fixtures/short.js +11 -0
- package/dist/src/targets/javascript/xhr/fixtures/text-plain.js +12 -0
- package/dist/src/targets/kotlin/okhttp/client.js +79 -0
- package/dist/src/targets/kotlin/target.js +15 -0
- package/dist/src/targets/node/axios/client.js +87 -0
- package/dist/src/targets/node/axios/fixtures/application-form-encoded.js +19 -0
- package/dist/src/targets/node/axios/fixtures/application-json.js +22 -0
- package/dist/src/targets/node/axios/fixtures/cookies.js +14 -0
- package/dist/src/targets/node/axios/fixtures/custom-method.js +10 -0
- package/dist/src/targets/node/axios/fixtures/full.js +22 -0
- package/dist/src/targets/node/axios/fixtures/headers.js +14 -0
- package/dist/src/targets/node/axios/fixtures/http-insecure.js +10 -0
- package/dist/src/targets/node/axios/fixtures/jsonObj-multiline.js +15 -0
- package/dist/src/targets/node/axios/fixtures/jsonObj-null-value.js +15 -0
- package/dist/src/targets/node/axios/fixtures/multipart-data.js +15 -0
- package/dist/src/targets/node/axios/fixtures/multipart-file.js +15 -0
- package/dist/src/targets/node/axios/fixtures/multipart-form-data-no-params.js +14 -0
- package/dist/src/targets/node/axios/fixtures/multipart-form-data.js +15 -0
- package/dist/src/targets/node/axios/fixtures/nested.js +13 -0
- package/dist/src/targets/node/axios/fixtures/query-encoded.js +13 -0
- package/dist/src/targets/node/axios/fixtures/query.js +13 -0
- package/dist/src/targets/node/axios/fixtures/short.js +10 -0
- package/dist/src/targets/node/axios/fixtures/text-plain.js +15 -0
- package/dist/src/targets/node/fetch/client.js +149 -0
- package/dist/src/targets/node/fetch/fixtures/application-form-encoded.js +15 -0
- package/dist/src/targets/node/fetch/fixtures/application-json.js +18 -0
- package/dist/src/targets/node/fetch/fixtures/cookies.js +7 -0
- package/dist/src/targets/node/fetch/fixtures/custom-method.js +7 -0
- package/dist/src/targets/node/fetch/fixtures/full.js +18 -0
- package/dist/src/targets/node/fetch/fixtures/headers.js +10 -0
- package/dist/src/targets/node/fetch/fixtures/http-insecure.js +7 -0
- package/dist/src/targets/node/fetch/fixtures/jsonObj-multiline.js +11 -0
- package/dist/src/targets/node/fetch/fixtures/jsonObj-null-value.js +11 -0
- package/dist/src/targets/node/fetch/fixtures/multipart-data.js +13 -0
- package/dist/src/targets/node/fetch/fixtures/multipart-file.js +12 -0
- package/dist/src/targets/node/fetch/fixtures/multipart-form-data-no-params.js +7 -0
- package/dist/src/targets/node/fetch/fixtures/multipart-form-data.js +11 -0
- package/dist/src/targets/node/fetch/fixtures/nested.js +7 -0
- package/dist/src/targets/node/fetch/fixtures/query-encoded.js +7 -0
- package/dist/src/targets/node/fetch/fixtures/query.js +7 -0
- package/dist/src/targets/node/fetch/fixtures/short.js +7 -0
- package/dist/src/targets/node/fetch/fixtures/text-plain.js +7 -0
- package/dist/src/targets/node/native/client.js +91 -0
- package/dist/src/targets/node/native/fixtures/application-form-encoded.js +24 -0
- package/dist/src/targets/node/native/fixtures/application-json.js +30 -0
- package/dist/src/targets/node/native/fixtures/cookies.js +22 -0
- package/dist/src/targets/node/native/fixtures/custom-method.js +20 -0
- package/dist/src/targets/node/native/fixtures/full.js +26 -0
- package/dist/src/targets/node/native/fixtures/headers.js +24 -0
- package/dist/src/targets/node/native/fixtures/http-insecure.js +20 -0
- package/dist/src/targets/node/native/fixtures/jsonObj-multiline.js +23 -0
- package/dist/src/targets/node/native/fixtures/jsonObj-null-value.js +23 -0
- package/dist/src/targets/node/native/fixtures/multipart-data.js +23 -0
- package/dist/src/targets/node/native/fixtures/multipart-file.js +23 -0
- package/dist/src/targets/node/native/fixtures/multipart-form-data-no-params.js +22 -0
- package/dist/src/targets/node/native/fixtures/multipart-form-data.js +23 -0
- package/dist/src/targets/node/native/fixtures/nested.js +20 -0
- package/dist/src/targets/node/native/fixtures/query-encoded.js +20 -0
- package/dist/src/targets/node/native/fixtures/query.js +20 -0
- package/dist/src/targets/node/native/fixtures/short.js +20 -0
- package/dist/src/targets/node/native/fixtures/text-plain.js +23 -0
- package/dist/src/targets/node/request/client.js +116 -0
- package/dist/src/targets/node/request/fixtures/application-form-encoded.js +13 -0
- package/dist/src/targets/node/request/fixtures/application-json.js +21 -0
- package/dist/src/targets/node/request/fixtures/cookies.js +11 -0
- package/dist/src/targets/node/request/fixtures/custom-method.js +8 -0
- package/dist/src/targets/node/request/fixtures/full.js +20 -0
- package/dist/src/targets/node/request/fixtures/headers.js +12 -0
- package/dist/src/targets/node/request/fixtures/http-insecure.js +8 -0
- package/dist/src/targets/node/request/fixtures/jsonObj-multiline.js +14 -0
- package/dist/src/targets/node/request/fixtures/jsonObj-null-value.js +14 -0
- package/dist/src/targets/node/request/fixtures/multipart-data.js +20 -0
- package/dist/src/targets/node/request/fixtures/multipart-file.js +19 -0
- package/dist/src/targets/node/request/fixtures/multipart-form-data-no-params.js +12 -0
- package/dist/src/targets/node/request/fixtures/multipart-form-data.js +13 -0
- package/dist/src/targets/node/request/fixtures/nested.js +11 -0
- package/dist/src/targets/node/request/fixtures/query-encoded.js +11 -0
- package/dist/src/targets/node/request/fixtures/query.js +11 -0
- package/dist/src/targets/node/request/fixtures/short.js +8 -0
- package/dist/src/targets/node/request/fixtures/text-plain.js +13 -0
- package/dist/src/targets/node/target.js +24 -0
- package/dist/src/targets/node/unirest/client.js +119 -0
- package/dist/src/targets/node/unirest/fixtures/application-form-encoded.js +15 -0
- package/dist/src/targets/node/unirest/fixtures/application-json.js +32 -0
- package/dist/src/targets/node/unirest/fixtures/cookies.js +12 -0
- package/dist/src/targets/node/unirest/fixtures/custom-method.js +8 -0
- package/dist/src/targets/node/unirest/fixtures/full.js +27 -0
- package/dist/src/targets/node/unirest/fixtures/headers.js +13 -0
- package/dist/src/targets/node/unirest/fixtures/http-insecure.js +8 -0
- package/dist/src/targets/node/unirest/fixtures/jsonObj-multiline.js +15 -0
- package/dist/src/targets/node/unirest/fixtures/jsonObj-null-value.js +15 -0
- package/dist/src/targets/node/unirest/fixtures/multipart-data.js +20 -0
- package/dist/src/targets/node/unirest/fixtures/multipart-file.js +18 -0
- package/dist/src/targets/node/unirest/fixtures/multipart-form-data-no-params.js +11 -0
- package/dist/src/targets/node/unirest/fixtures/multipart-form-data.js +16 -0
- package/dist/src/targets/node/unirest/fixtures/nested.js +13 -0
- package/dist/src/targets/node/unirest/fixtures/query-encoded.js +12 -0
- package/dist/src/targets/node/unirest/fixtures/query.js +16 -0
- package/dist/src/targets/node/unirest/fixtures/short.js +8 -0
- package/dist/src/targets/node/unirest/fixtures/text-plain.js +12 -0
- package/dist/src/targets/objc/helpers.js +59 -0
- package/dist/src/targets/objc/nsurlsession/client.js +151 -0
- package/dist/src/targets/objc/target.js +15 -0
- package/dist/src/targets/ocaml/cohttp/client.js +72 -0
- package/dist/src/targets/ocaml/target.js +15 -0
- package/dist/src/targets/php/curl/client.js +135 -0
- package/dist/src/targets/php/guzzle/client.js +126 -0
- package/dist/src/targets/php/helpers.js +63 -0
- package/dist/src/targets/php/http1/client.js +90 -0
- package/dist/src/targets/php/http2/client.js +128 -0
- package/dist/src/targets/php/target.js +22 -0
- package/dist/src/targets/powershell/common.js +49 -0
- package/dist/src/targets/powershell/restmethod/client.js +13 -0
- package/dist/src/targets/powershell/target.js +17 -0
- package/dist/src/targets/powershell/webrequest/client.js +13 -0
- package/dist/src/targets/python/helpers.js +70 -0
- package/dist/src/targets/python/requests/client.js +161 -0
- package/dist/src/targets/python/target.js +16 -0
- package/dist/src/targets/r/httr/client.js +125 -0
- package/dist/src/targets/r/target.js +15 -0
- package/dist/src/targets/ruby/native/client.js +69 -0
- package/dist/src/targets/ruby/target.js +15 -0
- package/dist/src/targets/shell/curl/client.js +171 -0
- package/dist/src/targets/shell/httpie/client.js +111 -0
- package/dist/src/targets/shell/target.js +20 -0
- package/dist/src/targets/shell/wget/client.js +55 -0
- package/dist/src/targets/swift/helpers.js +80 -0
- package/dist/src/targets/swift/nsurlsession/client.js +156 -0
- package/dist/src/targets/swift/target.js +15 -0
- package/dist/src/targets/targets.js +130 -0
- package/package.json +2 -3
- package/src/fixtures/customTarget.ts +0 -14
- package/src/fixtures/files/hello.txt +0 -1
- package/src/fixtures/mimetypes.ts +0 -84
- package/src/fixtures/requests/application-form-encoded.js +0 -68
- package/src/fixtures/requests/application-json.js +0 -71
- package/src/fixtures/requests/cookies.js +0 -50
- package/src/fixtures/requests/custom-method.js +0 -40
- package/src/fixtures/requests/full.js +0 -98
- package/src/fixtures/requests/headers.js +0 -55
- package/src/fixtures/requests/http-insecure.js +0 -44
- package/src/fixtures/requests/jsonObj-multiline.js +0 -58
- package/src/fixtures/requests/jsonObj-null-value.js +0 -65
- package/src/fixtures/requests/multipart-data.js +0 -71
- package/src/fixtures/requests/multipart-file.js +0 -64
- package/src/fixtures/requests/multipart-form-data-no-params.js +0 -55
- package/src/fixtures/requests/multipart-form-data.js +0 -63
- package/src/fixtures/requests/nested.js +0 -63
- package/src/fixtures/requests/query-encoded.js +0 -58
- package/src/fixtures/requests/query.js +0 -63
- package/src/fixtures/requests/short.js +0 -44
- package/src/fixtures/requests/text-plain.js +0 -56
- package/src/fixtures/runCustomFixtures.ts +0 -47
- package/src/helpers/__snapshots__/utils.test.ts.snap +0 -364
- package/src/helpers/code-builder.test.ts +0 -42
- package/src/helpers/code-builder.ts +0 -85
- package/src/helpers/form-data.ts +0 -76
- package/src/helpers/har-validator.ts +0 -35
- package/src/helpers/headers.test.ts +0 -35
- package/src/helpers/headers.ts +0 -31
- package/src/helpers/reducer.test.ts +0 -27
- package/src/helpers/reducer.ts +0 -19
- package/src/helpers/shell.ts +0 -18
- package/src/helpers/utils.test.ts +0 -19
- package/src/helpers/utils.ts +0 -16
- package/src/index.test.ts +0 -221
- package/src/index.ts +0 -361
- package/src/integration.test.ts +0 -270
- package/src/targets/c/libcurl/client.ts +0 -50
- package/src/targets/c/libcurl/fixtures/application-form-encoded.c +0 -12
- package/src/targets/c/libcurl/fixtures/application-json.c +0 -12
- package/src/targets/c/libcurl/fixtures/cookies.c +0 -8
- package/src/targets/c/libcurl/fixtures/custom-method.c +0 -6
- package/src/targets/c/libcurl/fixtures/full.c +0 -15
- package/src/targets/c/libcurl/fixtures/headers.c +0 -12
- package/src/targets/c/libcurl/fixtures/http-insecure.c +0 -6
- package/src/targets/c/libcurl/fixtures/jsonObj-multiline.c +0 -12
- package/src/targets/c/libcurl/fixtures/jsonObj-null-value.c +0 -12
- package/src/targets/c/libcurl/fixtures/multipart-data.c +0 -12
- package/src/targets/c/libcurl/fixtures/multipart-file.c +0 -12
- package/src/targets/c/libcurl/fixtures/multipart-form-data-no-params.c +0 -10
- package/src/targets/c/libcurl/fixtures/multipart-form-data.c +0 -12
- package/src/targets/c/libcurl/fixtures/nested.c +0 -6
- package/src/targets/c/libcurl/fixtures/query-encoded.c +0 -6
- package/src/targets/c/libcurl/fixtures/query.c +0 -6
- package/src/targets/c/libcurl/fixtures/short.c +0 -6
- package/src/targets/c/libcurl/fixtures/text-plain.c +0 -12
- package/src/targets/c/target.ts +0 -14
- package/src/targets/clojure/clj_http/client.ts +0 -210
- package/src/targets/clojure/clj_http/fixtures/application-form-encoded.clj +0 -4
- package/src/targets/clojure/clj_http/fixtures/application-json.clj +0 -9
- package/src/targets/clojure/clj_http/fixtures/cookies.clj +0 -3
- package/src/targets/clojure/clj_http/fixtures/custom-method.clj +0 -1
- package/src/targets/clojure/clj_http/fixtures/full.clj +0 -8
- package/src/targets/clojure/clj_http/fixtures/headers.clj +0 -5
- package/src/targets/clojure/clj_http/fixtures/http-insecure.clj +0 -3
- package/src/targets/clojure/clj_http/fixtures/jsonObj-multiline.clj +0 -4
- package/src/targets/clojure/clj_http/fixtures/jsonObj-null-value.clj +0 -4
- package/src/targets/clojure/clj_http/fixtures/multipart-data.clj +0 -5
- package/src/targets/clojure/clj_http/fixtures/multipart-file.clj +0 -4
- package/src/targets/clojure/clj_http/fixtures/multipart-form-data-no-params.clj +0 -3
- package/src/targets/clojure/clj_http/fixtures/multipart-form-data.clj +0 -4
- package/src/targets/clojure/clj_http/fixtures/nested.clj +0 -5
- package/src/targets/clojure/clj_http/fixtures/query-encoded.clj +0 -4
- package/src/targets/clojure/clj_http/fixtures/query.clj +0 -5
- package/src/targets/clojure/clj_http/fixtures/short.clj +0 -3
- package/src/targets/clojure/clj_http/fixtures/text-plain.clj +0 -3
- package/src/targets/clojure/target.ts +0 -14
- package/src/targets/csharp/httpclient/client.ts +0 -170
- package/src/targets/csharp/httpclient/fixtures/application-form-encoded.cs +0 -18
- package/src/targets/csharp/httpclient/fixtures/application-json.cs +0 -20
- package/src/targets/csharp/httpclient/fixtures/cookies.cs +0 -21
- package/src/targets/csharp/httpclient/fixtures/custom-method.cs +0 -13
- package/src/targets/csharp/httpclient/fixtures/full.cs +0 -26
- package/src/targets/csharp/httpclient/fixtures/headers.cs +0 -19
- package/src/targets/csharp/httpclient/fixtures/http-insecure.cs +0 -13
- package/src/targets/csharp/httpclient/fixtures/jsonObj-multiline.cs +0 -20
- package/src/targets/csharp/httpclient/fixtures/jsonObj-null-value.cs +0 -20
- package/src/targets/csharp/httpclient/fixtures/multipart-data.cs +0 -38
- package/src/targets/csharp/httpclient/fixtures/multipart-file.cs +0 -28
- package/src/targets/csharp/httpclient/fixtures/multipart-form-data-no-params.cs +0 -13
- package/src/targets/csharp/httpclient/fixtures/multipart-form-data.cs +0 -26
- package/src/targets/csharp/httpclient/fixtures/nested.cs +0 -13
- package/src/targets/csharp/httpclient/fixtures/query-encoded.cs +0 -13
- package/src/targets/csharp/httpclient/fixtures/query.cs +0 -13
- package/src/targets/csharp/httpclient/fixtures/short.cs +0 -13
- package/src/targets/csharp/httpclient/fixtures/text-plain.cs +0 -20
- package/src/targets/csharp/restsharp/client.ts +0 -44
- package/src/targets/csharp/restsharp/fixtures/application-form-encoded.cs +0 -5
- package/src/targets/csharp/restsharp/fixtures/application-json.cs +0 -5
- package/src/targets/csharp/restsharp/fixtures/cookies.cs +0 -5
- package/src/targets/csharp/restsharp/fixtures/custom-method.cs +0 -1
- package/src/targets/csharp/restsharp/fixtures/full.cs +0 -8
- package/src/targets/csharp/restsharp/fixtures/headers.cs +0 -6
- package/src/targets/csharp/restsharp/fixtures/http-insecure.cs +0 -3
- package/src/targets/csharp/restsharp/fixtures/jsonObj-multiline.cs +0 -5
- package/src/targets/csharp/restsharp/fixtures/jsonObj-null-value.cs +0 -5
- package/src/targets/csharp/restsharp/fixtures/multipart-data.cs +0 -5
- package/src/targets/csharp/restsharp/fixtures/multipart-file.cs +0 -5
- package/src/targets/csharp/restsharp/fixtures/multipart-form-data-no-params.cs +0 -4
- package/src/targets/csharp/restsharp/fixtures/multipart-form-data.cs +0 -5
- package/src/targets/csharp/restsharp/fixtures/nested.cs +0 -3
- package/src/targets/csharp/restsharp/fixtures/query-encoded.cs +0 -3
- package/src/targets/csharp/restsharp/fixtures/query.cs +0 -3
- package/src/targets/csharp/restsharp/fixtures/short.cs +0 -3
- package/src/targets/csharp/restsharp/fixtures/text-plain.cs +0 -5
- package/src/targets/csharp/target.ts +0 -17
- package/src/targets/go/native/client.test.ts +0 -42
- package/src/targets/go/native/client.ts +0 -143
- package/src/targets/go/native/fixtures/application-form-encoded.go +0 -28
- package/src/targets/go/native/fixtures/application-json.go +0 -28
- package/src/targets/go/native/fixtures/boilerplate-option.go +0 -17
- package/src/targets/go/native/fixtures/check-errors-option.go +0 -39
- package/src/targets/go/native/fixtures/cookies.go +0 -25
- package/src/targets/go/native/fixtures/custom-method.go +0 -23
- package/src/targets/go/native/fixtures/full.go +0 -30
- package/src/targets/go/native/fixtures/headers.go +0 -27
- package/src/targets/go/native/fixtures/http-insecure.go +0 -23
- package/src/targets/go/native/fixtures/jsonObj-multiline.go +0 -28
- package/src/targets/go/native/fixtures/jsonObj-null-value.go +0 -28
- package/src/targets/go/native/fixtures/multipart-data.go +0 -28
- package/src/targets/go/native/fixtures/multipart-file.go +0 -28
- package/src/targets/go/native/fixtures/multipart-form-data-no-params.go +0 -25
- package/src/targets/go/native/fixtures/multipart-form-data.go +0 -28
- package/src/targets/go/native/fixtures/nested.go +0 -23
- package/src/targets/go/native/fixtures/print-body-option.go +0 -25
- package/src/targets/go/native/fixtures/query-encoded.go +0 -23
- package/src/targets/go/native/fixtures/query.go +0 -23
- package/src/targets/go/native/fixtures/short.go +0 -23
- package/src/targets/go/native/fixtures/text-plain.go +0 -28
- package/src/targets/go/native/fixtures/timeout-option.go +0 -35
- package/src/targets/go/target.ts +0 -14
- package/src/targets/har-schema.d.ts +0 -4
- package/src/targets/http/http1.1/client.ts +0 -89
- package/src/targets/http/http1.1/fixtures/application-form-encoded +0 -6
- package/src/targets/http/http1.1/fixtures/application-json +0 -6
- package/src/targets/http/http1.1/fixtures/cookies +0 -4
- package/src/targets/http/http1.1/fixtures/custom-method +0 -3
- package/src/targets/http/http1.1/fixtures/full +0 -8
- package/src/targets/http/http1.1/fixtures/headers +0 -6
- package/src/targets/http/http1.1/fixtures/http-insecure +0 -3
- package/src/targets/http/http1.1/fixtures/jsonObj-multiline +0 -8
- package/src/targets/http/http1.1/fixtures/jsonObj-null-value +0 -6
- package/src/targets/http/http1.1/fixtures/multipart-data +0 -15
- package/src/targets/http/http1.1/fixtures/multipart-file +0 -11
- package/src/targets/http/http1.1/fixtures/multipart-form-data +0 -10
- package/src/targets/http/http1.1/fixtures/multipart-form-data-no-params +0 -4
- package/src/targets/http/http1.1/fixtures/nested +0 -3
- package/src/targets/http/http1.1/fixtures/query +0 -3
- package/src/targets/http/http1.1/fixtures/query-encoded +0 -3
- package/src/targets/http/http1.1/fixtures/short +0 -3
- package/src/targets/http/http1.1/fixtures/text-plain +0 -6
- package/src/targets/http/target.ts +0 -14
- package/src/targets/java/asynchttp/client.ts +0 -50
- package/src/targets/java/asynchttp/fixtures/application-form-encoded.java +0 -10
- package/src/targets/java/asynchttp/fixtures/application-json.java +0 -10
- package/src/targets/java/asynchttp/fixtures/cookies.java +0 -9
- package/src/targets/java/asynchttp/fixtures/custom-method.java +0 -8
- package/src/targets/java/asynchttp/fixtures/full.java +0 -12
- package/src/targets/java/asynchttp/fixtures/headers.java +0 -11
- package/src/targets/java/asynchttp/fixtures/http-insecure.java +0 -8
- package/src/targets/java/asynchttp/fixtures/jsonObj-multiline.java +0 -10
- package/src/targets/java/asynchttp/fixtures/jsonObj-null-value.java +0 -10
- package/src/targets/java/asynchttp/fixtures/multipart-data.java +0 -10
- package/src/targets/java/asynchttp/fixtures/multipart-file.java +0 -10
- package/src/targets/java/asynchttp/fixtures/multipart-form-data-no-params.java +0 -9
- package/src/targets/java/asynchttp/fixtures/multipart-form-data.java +0 -10
- package/src/targets/java/asynchttp/fixtures/nested.java +0 -8
- package/src/targets/java/asynchttp/fixtures/query-encoded.java +0 -8
- package/src/targets/java/asynchttp/fixtures/query.java +0 -8
- package/src/targets/java/asynchttp/fixtures/short.java +0 -8
- package/src/targets/java/asynchttp/fixtures/text-plain.java +0 -10
- package/src/targets/java/nethttp/client.ts +0 -58
- package/src/targets/java/nethttp/fixtures/application-form-encoded.java +0 -7
- package/src/targets/java/nethttp/fixtures/application-json.java +0 -7
- package/src/targets/java/nethttp/fixtures/cookies.java +0 -7
- package/src/targets/java/nethttp/fixtures/custom-method.java +0 -6
- package/src/targets/java/nethttp/fixtures/full.java +0 -9
- package/src/targets/java/nethttp/fixtures/headers.java +0 -9
- package/src/targets/java/nethttp/fixtures/http-insecure.java +0 -6
- package/src/targets/java/nethttp/fixtures/jsonObj-multiline.java +0 -7
- package/src/targets/java/nethttp/fixtures/jsonObj-null-value.java +0 -7
- package/src/targets/java/nethttp/fixtures/multipart-data.java +0 -7
- package/src/targets/java/nethttp/fixtures/multipart-file.java +0 -7
- package/src/targets/java/nethttp/fixtures/multipart-form-data-no-params.java +0 -7
- package/src/targets/java/nethttp/fixtures/multipart-form-data.java +0 -7
- package/src/targets/java/nethttp/fixtures/nested.java +0 -6
- package/src/targets/java/nethttp/fixtures/query-encoded.java +0 -6
- package/src/targets/java/nethttp/fixtures/query.java +0 -6
- package/src/targets/java/nethttp/fixtures/short.java +0 -6
- package/src/targets/java/nethttp/fixtures/text-plain.java +0 -7
- package/src/targets/java/okhttp/client.ts +0 -72
- package/src/targets/java/okhttp/fixtures/application-form-encoded.java +0 -11
- package/src/targets/java/okhttp/fixtures/application-json.java +0 -11
- package/src/targets/java/okhttp/fixtures/cookies.java +0 -9
- package/src/targets/java/okhttp/fixtures/custom-method.java +0 -8
- package/src/targets/java/okhttp/fixtures/full.java +0 -13
- package/src/targets/java/okhttp/fixtures/headers.java +0 -11
- package/src/targets/java/okhttp/fixtures/http-insecure.java +0 -8
- package/src/targets/java/okhttp/fixtures/jsonObj-multiline.java +0 -11
- package/src/targets/java/okhttp/fixtures/jsonObj-null-value.java +0 -11
- package/src/targets/java/okhttp/fixtures/multipart-data.java +0 -11
- package/src/targets/java/okhttp/fixtures/multipart-file.java +0 -11
- package/src/targets/java/okhttp/fixtures/multipart-form-data-no-params.java +0 -9
- package/src/targets/java/okhttp/fixtures/multipart-form-data.java +0 -11
- package/src/targets/java/okhttp/fixtures/nested.java +0 -8
- package/src/targets/java/okhttp/fixtures/query-encoded.java +0 -8
- package/src/targets/java/okhttp/fixtures/query.java +0 -8
- package/src/targets/java/okhttp/fixtures/short.java +0 -8
- package/src/targets/java/okhttp/fixtures/text-plain.java +0 -11
- package/src/targets/java/target.ts +0 -21
- package/src/targets/java/unirest/client.ts +0 -50
- package/src/targets/java/unirest/fixtures/application-form-encoded.java +0 -4
- package/src/targets/java/unirest/fixtures/application-json.java +0 -4
- package/src/targets/java/unirest/fixtures/cookies.java +0 -3
- package/src/targets/java/unirest/fixtures/custom-method.java +0 -2
- package/src/targets/java/unirest/fixtures/full.java +0 -6
- package/src/targets/java/unirest/fixtures/headers.java +0 -5
- package/src/targets/java/unirest/fixtures/http-insecure.java +0 -2
- package/src/targets/java/unirest/fixtures/jsonObj-multiline.java +0 -4
- package/src/targets/java/unirest/fixtures/jsonObj-null-value.java +0 -4
- package/src/targets/java/unirest/fixtures/multipart-data.java +0 -4
- package/src/targets/java/unirest/fixtures/multipart-file.java +0 -4
- package/src/targets/java/unirest/fixtures/multipart-form-data-no-params.java +0 -3
- package/src/targets/java/unirest/fixtures/multipart-form-data.java +0 -4
- package/src/targets/java/unirest/fixtures/nested.java +0 -2
- package/src/targets/java/unirest/fixtures/query-encoded.java +0 -2
- package/src/targets/java/unirest/fixtures/query.java +0 -2
- package/src/targets/java/unirest/fixtures/short.java +0 -2
- package/src/targets/java/unirest/fixtures/text-plain.java +0 -4
- package/src/targets/javascript/axios/client.ts +0 -109
- package/src/targets/javascript/axios/fixtures/application-form-encoded.js +0 -21
- package/src/targets/javascript/axios/fixtures/application-json.js +0 -24
- package/src/targets/javascript/axios/fixtures/cookies.js +0 -16
- package/src/targets/javascript/axios/fixtures/custom-method.js +0 -12
- package/src/targets/javascript/axios/fixtures/full.js +0 -25
- package/src/targets/javascript/axios/fixtures/headers.js +0 -16
- package/src/targets/javascript/axios/fixtures/http-insecure.js +0 -12
- package/src/targets/javascript/axios/fixtures/jsonObj-multiline.js +0 -17
- package/src/targets/javascript/axios/fixtures/jsonObj-null-value.js +0 -17
- package/src/targets/javascript/axios/fixtures/multipart-data.js +0 -21
- package/src/targets/javascript/axios/fixtures/multipart-file.js +0 -20
- package/src/targets/javascript/axios/fixtures/multipart-form-data-no-params.js +0 -16
- package/src/targets/javascript/axios/fixtures/multipart-form-data.js +0 -20
- package/src/targets/javascript/axios/fixtures/nested.js +0 -16
- package/src/targets/javascript/axios/fixtures/query-encoded.js +0 -19
- package/src/targets/javascript/axios/fixtures/query.js +0 -16
- package/src/targets/javascript/axios/fixtures/short.js +0 -12
- package/src/targets/javascript/axios/fixtures/text-plain.js +0 -17
- package/src/targets/javascript/fetch/client.ts +0 -129
- package/src/targets/javascript/fetch/fixtures/application-form-encoded.js +0 -10
- package/src/targets/javascript/fetch/fixtures/application-json.js +0 -17
- package/src/targets/javascript/fetch/fixtures/cookies.js +0 -6
- package/src/targets/javascript/fetch/fixtures/custom-method.js +0 -6
- package/src/targets/javascript/fetch/fixtures/full.js +0 -14
- package/src/targets/javascript/fetch/fixtures/headers.js +0 -9
- package/src/targets/javascript/fetch/fixtures/http-insecure.js +0 -6
- package/src/targets/javascript/fetch/fixtures/jsonObj-multiline.js +0 -10
- package/src/targets/javascript/fetch/fixtures/jsonObj-null-value.js +0 -10
- package/src/targets/javascript/fetch/fixtures/multipart-data.js +0 -12
- package/src/targets/javascript/fetch/fixtures/multipart-file.js +0 -11
- package/src/targets/javascript/fetch/fixtures/multipart-form-data-no-params.js +0 -6
- package/src/targets/javascript/fetch/fixtures/multipart-form-data.js +0 -11
- package/src/targets/javascript/fetch/fixtures/nested.js +0 -6
- package/src/targets/javascript/fetch/fixtures/query-encoded.js +0 -6
- package/src/targets/javascript/fetch/fixtures/query.js +0 -6
- package/src/targets/javascript/fetch/fixtures/short.js +0 -6
- package/src/targets/javascript/fetch/fixtures/text-plain.js +0 -6
- package/src/targets/javascript/jquery/client.ts +0 -95
- package/src/targets/javascript/jquery/fixtures/application-form-encoded.js +0 -17
- package/src/targets/javascript/jquery/fixtures/application-json.js +0 -15
- package/src/targets/javascript/jquery/fixtures/cookies.js +0 -13
- package/src/targets/javascript/jquery/fixtures/custom-method.js +0 -11
- package/src/targets/javascript/jquery/fixtures/full.js +0 -18
- package/src/targets/javascript/jquery/fixtures/headers.js +0 -15
- package/src/targets/javascript/jquery/fixtures/http-insecure.js +0 -11
- package/src/targets/javascript/jquery/fixtures/jsonObj-multiline.js +0 -15
- package/src/targets/javascript/jquery/fixtures/jsonObj-null-value.js +0 -15
- package/src/targets/javascript/jquery/fixtures/multipart-data.js +0 -19
- package/src/targets/javascript/jquery/fixtures/multipart-file.js +0 -18
- package/src/targets/javascript/jquery/fixtures/multipart-form-data-no-params.js +0 -13
- package/src/targets/javascript/jquery/fixtures/multipart-form-data.js +0 -18
- package/src/targets/javascript/jquery/fixtures/nested.js +0 -11
- package/src/targets/javascript/jquery/fixtures/query-encoded.js +0 -11
- package/src/targets/javascript/jquery/fixtures/query.js +0 -11
- package/src/targets/javascript/jquery/fixtures/short.js +0 -11
- package/src/targets/javascript/jquery/fixtures/text-plain.js +0 -14
- package/src/targets/javascript/target.ts +0 -21
- package/src/targets/javascript/xhr/client.test.ts +0 -18
- package/src/targets/javascript/xhr/client.ts +0 -100
- package/src/targets/javascript/xhr/fixtures/application-form-encoded.js +0 -15
- package/src/targets/javascript/xhr/fixtures/application-json.js +0 -34
- package/src/targets/javascript/xhr/fixtures/cookies.js +0 -15
- package/src/targets/javascript/xhr/fixtures/cors.js +0 -13
- package/src/targets/javascript/xhr/fixtures/custom-method.js +0 -14
- package/src/targets/javascript/xhr/fixtures/full.js +0 -17
- package/src/targets/javascript/xhr/fixtures/headers.js +0 -17
- package/src/targets/javascript/xhr/fixtures/http-insecure.js +0 -14
- package/src/targets/javascript/xhr/fixtures/jsonObj-multiline.js +0 -17
- package/src/targets/javascript/xhr/fixtures/jsonObj-null-value.js +0 -17
- package/src/targets/javascript/xhr/fixtures/multipart-data.js +0 -16
- package/src/targets/javascript/xhr/fixtures/multipart-file.js +0 -15
- package/src/targets/javascript/xhr/fixtures/multipart-form-data-no-params.js +0 -13
- package/src/targets/javascript/xhr/fixtures/multipart-form-data.js +0 -15
- package/src/targets/javascript/xhr/fixtures/nested.js +0 -14
- package/src/targets/javascript/xhr/fixtures/query-encoded.js +0 -14
- package/src/targets/javascript/xhr/fixtures/query.js +0 -14
- package/src/targets/javascript/xhr/fixtures/short.js +0 -14
- package/src/targets/javascript/xhr/fixtures/text-plain.js +0 -15
- package/src/targets/kotlin/okhttp/client.ts +0 -73
- package/src/targets/kotlin/okhttp/fixtures/application-form-encoded.kt +0 -11
- package/src/targets/kotlin/okhttp/fixtures/application-json.kt +0 -11
- package/src/targets/kotlin/okhttp/fixtures/cookies.kt +0 -9
- package/src/targets/kotlin/okhttp/fixtures/custom-method.kt +0 -8
- package/src/targets/kotlin/okhttp/fixtures/full.kt +0 -13
- package/src/targets/kotlin/okhttp/fixtures/headers.kt +0 -11
- package/src/targets/kotlin/okhttp/fixtures/http-insecure.kt +0 -8
- package/src/targets/kotlin/okhttp/fixtures/jsonObj-multiline.kt +0 -11
- package/src/targets/kotlin/okhttp/fixtures/jsonObj-null-value.kt +0 -11
- package/src/targets/kotlin/okhttp/fixtures/multipart-data.kt +0 -11
- package/src/targets/kotlin/okhttp/fixtures/multipart-file.kt +0 -11
- package/src/targets/kotlin/okhttp/fixtures/multipart-form-data-no-params.kt +0 -9
- package/src/targets/kotlin/okhttp/fixtures/multipart-form-data.kt +0 -11
- package/src/targets/kotlin/okhttp/fixtures/nested.kt +0 -8
- package/src/targets/kotlin/okhttp/fixtures/query-encoded.kt +0 -8
- package/src/targets/kotlin/okhttp/fixtures/query.kt +0 -8
- package/src/targets/kotlin/okhttp/fixtures/short.kt +0 -8
- package/src/targets/kotlin/okhttp/fixtures/text-plain.kt +0 -11
- package/src/targets/kotlin/target.ts +0 -14
- package/src/targets/node/axios/client.ts +0 -89
- package/src/targets/node/axios/fixtures/application-form-encoded.js +0 -22
- package/src/targets/node/axios/fixtures/application-json.js +0 -24
- package/src/targets/node/axios/fixtures/cookies.js +0 -16
- package/src/targets/node/axios/fixtures/custom-method.js +0 -12
- package/src/targets/node/axios/fixtures/full.js +0 -25
- package/src/targets/node/axios/fixtures/headers.js +0 -16
- package/src/targets/node/axios/fixtures/http-insecure.js +0 -12
- package/src/targets/node/axios/fixtures/jsonObj-multiline.js +0 -17
- package/src/targets/node/axios/fixtures/jsonObj-null-value.js +0 -17
- package/src/targets/node/axios/fixtures/multipart-data.js +0 -17
- package/src/targets/node/axios/fixtures/multipart-file.js +0 -17
- package/src/targets/node/axios/fixtures/multipart-form-data-no-params.js +0 -16
- package/src/targets/node/axios/fixtures/multipart-form-data.js +0 -17
- package/src/targets/node/axios/fixtures/nested.js +0 -15
- package/src/targets/node/axios/fixtures/query-encoded.js +0 -15
- package/src/targets/node/axios/fixtures/query.js +0 -15
- package/src/targets/node/axios/fixtures/short.js +0 -12
- package/src/targets/node/axios/fixtures/text-plain.js +0 -17
- package/src/targets/node/fetch/client.ts +0 -153
- package/src/targets/node/fetch/fixtures/application-form-encoded.js +0 -18
- package/src/targets/node/fetch/fixtures/application-json.js +0 -20
- package/src/targets/node/fetch/fixtures/cookies.js +0 -9
- package/src/targets/node/fetch/fixtures/custom-method.js +0 -9
- package/src/targets/node/fetch/fixtures/full.js +0 -21
- package/src/targets/node/fetch/fixtures/headers.js +0 -12
- package/src/targets/node/fetch/fixtures/http-insecure.js +0 -9
- package/src/targets/node/fetch/fixtures/jsonObj-multiline.js +0 -13
- package/src/targets/node/fetch/fixtures/jsonObj-null-value.js +0 -13
- package/src/targets/node/fetch/fixtures/multipart-data.js +0 -17
- package/src/targets/node/fetch/fixtures/multipart-file.js +0 -16
- package/src/targets/node/fetch/fixtures/multipart-form-data-no-params.js +0 -9
- package/src/targets/node/fetch/fixtures/multipart-form-data.js +0 -15
- package/src/targets/node/fetch/fixtures/nested.js +0 -9
- package/src/targets/node/fetch/fixtures/query-encoded.js +0 -9
- package/src/targets/node/fetch/fixtures/query.js +0 -9
- package/src/targets/node/fetch/fixtures/short.js +0 -9
- package/src/targets/node/fetch/fixtures/text-plain.js +0 -9
- package/src/targets/node/native/client.ts +0 -91
- package/src/targets/node/native/fixtures/application-form-encoded.js +0 -28
- package/src/targets/node/native/fixtures/application-json.js +0 -34
- package/src/targets/node/native/fixtures/cookies.js +0 -26
- package/src/targets/node/native/fixtures/custom-method.js +0 -24
- package/src/targets/node/native/fixtures/full.js +0 -30
- package/src/targets/node/native/fixtures/headers.js +0 -28
- package/src/targets/node/native/fixtures/http-insecure.js +0 -24
- package/src/targets/node/native/fixtures/jsonObj-multiline.js +0 -27
- package/src/targets/node/native/fixtures/jsonObj-null-value.js +0 -27
- package/src/targets/node/native/fixtures/multipart-data.js +0 -27
- package/src/targets/node/native/fixtures/multipart-file.js +0 -27
- package/src/targets/node/native/fixtures/multipart-form-data-no-params.js +0 -26
- package/src/targets/node/native/fixtures/multipart-form-data.js +0 -27
- package/src/targets/node/native/fixtures/nested.js +0 -24
- package/src/targets/node/native/fixtures/query-encoded.js +0 -24
- package/src/targets/node/native/fixtures/query.js +0 -24
- package/src/targets/node/native/fixtures/short.js +0 -24
- package/src/targets/node/native/fixtures/text-plain.js +0 -27
- package/src/targets/node/request/client.ts +0 -130
- package/src/targets/node/request/fixtures/application-form-encoded.js +0 -14
- package/src/targets/node/request/fixtures/application-json.js +0 -22
- package/src/targets/node/request/fixtures/cookies.js +0 -13
- package/src/targets/node/request/fixtures/custom-method.js +0 -9
- package/src/targets/node/request/fixtures/full.js +0 -22
- package/src/targets/node/request/fixtures/headers.js +0 -13
- package/src/targets/node/request/fixtures/http-insecure.js +0 -9
- package/src/targets/node/request/fixtures/jsonObj-multiline.js +0 -15
- package/src/targets/node/request/fixtures/jsonObj-null-value.js +0 -15
- package/src/targets/node/request/fixtures/multipart-data.js +0 -21
- package/src/targets/node/request/fixtures/multipart-file.js +0 -20
- package/src/targets/node/request/fixtures/multipart-form-data-no-params.js +0 -13
- package/src/targets/node/request/fixtures/multipart-form-data.js +0 -14
- package/src/targets/node/request/fixtures/nested.js +0 -12
- package/src/targets/node/request/fixtures/query-encoded.js +0 -12
- package/src/targets/node/request/fixtures/query.js +0 -12
- package/src/targets/node/request/fixtures/short.js +0 -9
- package/src/targets/node/request/fixtures/text-plain.js +0 -14
- package/src/targets/node/target.ts +0 -23
- package/src/targets/node/unirest/client.ts +0 -129
- package/src/targets/node/unirest/fixtures/application-form-encoded.js +0 -18
- package/src/targets/node/unirest/fixtures/application-json.js +0 -35
- package/src/targets/node/unirest/fixtures/cookies.js +0 -14
- package/src/targets/node/unirest/fixtures/custom-method.js +0 -9
- package/src/targets/node/unirest/fixtures/full.js +0 -32
- package/src/targets/node/unirest/fixtures/headers.js +0 -15
- package/src/targets/node/unirest/fixtures/http-insecure.js +0 -9
- package/src/targets/node/unirest/fixtures/jsonObj-multiline.js +0 -18
- package/src/targets/node/unirest/fixtures/jsonObj-null-value.js +0 -18
- package/src/targets/node/unirest/fixtures/multipart-data.js +0 -23
- package/src/targets/node/unirest/fixtures/multipart-file.js +0 -21
- package/src/targets/node/unirest/fixtures/multipart-form-data-no-params.js +0 -13
- package/src/targets/node/unirest/fixtures/multipart-form-data.js +0 -19
- package/src/targets/node/unirest/fixtures/nested.js +0 -15
- package/src/targets/node/unirest/fixtures/query-encoded.js +0 -14
- package/src/targets/node/unirest/fixtures/query.js +0 -18
- package/src/targets/node/unirest/fixtures/short.js +0 -9
- package/src/targets/node/unirest/fixtures/text-plain.js +0 -15
- package/src/targets/objc/helpers.ts +0 -60
- package/src/targets/objc/nsurlsession/client.test.ts +0 -36
- package/src/targets/objc/nsurlsession/client.ts +0 -164
- package/src/targets/objc/nsurlsession/fixtures/application-form-encoded.m +0 -25
- package/src/targets/objc/nsurlsession/fixtures/application-json.m +0 -30
- package/src/targets/objc/nsurlsession/fixtures/cookies.m +0 -21
- package/src/targets/objc/nsurlsession/fixtures/custom-method.m +0 -18
- package/src/targets/objc/nsurlsession/fixtures/full.m +0 -26
- package/src/targets/objc/nsurlsession/fixtures/headers.m +0 -23
- package/src/targets/objc/nsurlsession/fixtures/http-insecure.m +0 -18
- package/src/targets/objc/nsurlsession/fixtures/indent-option.m +0 -18
- package/src/targets/objc/nsurlsession/fixtures/json-with-null-value.m +0 -25
- package/src/targets/objc/nsurlsession/fixtures/jsonObj-multiline.m +0 -25
- package/src/targets/objc/nsurlsession/fixtures/jsonObj-null-value.m +0 -25
- package/src/targets/objc/nsurlsession/fixtures/multipart-data.m +0 -44
- package/src/targets/objc/nsurlsession/fixtures/multipart-file.m +0 -43
- package/src/targets/objc/nsurlsession/fixtures/multipart-form-data-no-params.m +0 -21
- package/src/targets/objc/nsurlsession/fixtures/multipart-form-data.m +0 -43
- package/src/targets/objc/nsurlsession/fixtures/nested.m +0 -18
- package/src/targets/objc/nsurlsession/fixtures/pretty-option.m +0 -24
- package/src/targets/objc/nsurlsession/fixtures/query-encoded.m +0 -18
- package/src/targets/objc/nsurlsession/fixtures/query.m +0 -18
- package/src/targets/objc/nsurlsession/fixtures/short.m +0 -18
- package/src/targets/objc/nsurlsession/fixtures/text-plain.m +0 -24
- package/src/targets/objc/nsurlsession/fixtures/timeout-option.m +0 -18
- package/src/targets/objc/target.ts +0 -14
- package/src/targets/ocaml/cohttp/client.ts +0 -72
- package/src/targets/ocaml/cohttp/fixtures/application-form-encoded.ml +0 -11
- package/src/targets/ocaml/cohttp/fixtures/application-json.ml +0 -11
- package/src/targets/ocaml/cohttp/fixtures/cookies.ml +0 -10
- package/src/targets/ocaml/cohttp/fixtures/custom-method.ml +0 -9
- package/src/targets/ocaml/cohttp/fixtures/full.ml +0 -15
- package/src/targets/ocaml/cohttp/fixtures/headers.ml +0 -14
- package/src/targets/ocaml/cohttp/fixtures/http-insecure.ml +0 -9
- package/src/targets/ocaml/cohttp/fixtures/jsonObj-multiline.ml +0 -11
- package/src/targets/ocaml/cohttp/fixtures/jsonObj-null-value.ml +0 -11
- package/src/targets/ocaml/cohttp/fixtures/multipart-data.ml +0 -11
- package/src/targets/ocaml/cohttp/fixtures/multipart-file.ml +0 -11
- package/src/targets/ocaml/cohttp/fixtures/multipart-form-data-no-params.ml +0 -10
- package/src/targets/ocaml/cohttp/fixtures/multipart-form-data.ml +0 -11
- package/src/targets/ocaml/cohttp/fixtures/nested.ml +0 -9
- package/src/targets/ocaml/cohttp/fixtures/query-encoded.ml +0 -9
- package/src/targets/ocaml/cohttp/fixtures/query.ml +0 -9
- package/src/targets/ocaml/cohttp/fixtures/short.ml +0 -9
- package/src/targets/ocaml/cohttp/fixtures/text-plain.ml +0 -11
- package/src/targets/ocaml/target.ts +0 -14
- package/src/targets/php/curl/client.ts +0 -154
- package/src/targets/php/curl/fixtures/application-form-encoded.php +0 -28
- package/src/targets/php/curl/fixtures/application-json.php +0 -28
- package/src/targets/php/curl/fixtures/cookies.php +0 -25
- package/src/targets/php/curl/fixtures/custom-method.php +0 -24
- package/src/targets/php/curl/fixtures/full.php +0 -30
- package/src/targets/php/curl/fixtures/headers.php +0 -29
- package/src/targets/php/curl/fixtures/http-insecure.php +0 -24
- package/src/targets/php/curl/fixtures/jsonObj-multiline.php +0 -28
- package/src/targets/php/curl/fixtures/jsonObj-null-value.php +0 -28
- package/src/targets/php/curl/fixtures/multipart-data.php +0 -28
- package/src/targets/php/curl/fixtures/multipart-file.php +0 -28
- package/src/targets/php/curl/fixtures/multipart-form-data-no-params.php +0 -28
- package/src/targets/php/curl/fixtures/multipart-form-data.php +0 -28
- package/src/targets/php/curl/fixtures/nested.php +0 -24
- package/src/targets/php/curl/fixtures/query-encoded.php +0 -24
- package/src/targets/php/curl/fixtures/query.php +0 -24
- package/src/targets/php/curl/fixtures/short.php +0 -24
- package/src/targets/php/curl/fixtures/text-plain.php +0 -28
- package/src/targets/php/guzzle/client.ts +0 -151
- package/src/targets/php/guzzle/fixtures/application-form-encoded.php +0 -16
- package/src/targets/php/guzzle/fixtures/application-json.php +0 -13
- package/src/targets/php/guzzle/fixtures/cookies.php +0 -12
- package/src/targets/php/guzzle/fixtures/custom-method.php +0 -8
- package/src/targets/php/guzzle/fixtures/full.php +0 -17
- package/src/targets/php/guzzle/fixtures/headers.php +0 -14
- package/src/targets/php/guzzle/fixtures/http-insecure.php +0 -8
- package/src/targets/php/guzzle/fixtures/jsonObj-multiline.php +0 -15
- package/src/targets/php/guzzle/fixtures/jsonObj-null-value.php +0 -13
- package/src/targets/php/guzzle/fixtures/multipart-data.php +0 -23
- package/src/targets/php/guzzle/fixtures/multipart-file.php +0 -19
- package/src/targets/php/guzzle/fixtures/multipart-form-data-no-params.php +0 -12
- package/src/targets/php/guzzle/fixtures/multipart-form-data.php +0 -15
- package/src/targets/php/guzzle/fixtures/nested.php +0 -8
- package/src/targets/php/guzzle/fixtures/query-encoded.php +0 -8
- package/src/targets/php/guzzle/fixtures/query.php +0 -8
- package/src/targets/php/guzzle/fixtures/short.php +0 -8
- package/src/targets/php/guzzle/fixtures/text-plain.php +0 -13
- package/src/targets/php/helpers.ts +0 -67
- package/src/targets/php/http1/client.ts +0 -103
- package/src/targets/php/http1/fixtures/application-form-encoded.php +0 -23
- package/src/targets/php/http1/fixtures/application-json.php +0 -19
- package/src/targets/php/http1/fixtures/cookies.php +0 -18
- package/src/targets/php/http1/fixtures/custom-method.php +0 -13
- package/src/targets/php/http1/fixtures/full.php +0 -37
- package/src/targets/php/http1/fixtures/headers.php +0 -19
- package/src/targets/php/http1/fixtures/http-insecure.php +0 -13
- package/src/targets/php/http1/fixtures/jsonObj-multiline.php +0 -21
- package/src/targets/php/http1/fixtures/jsonObj-null-value.php +0 -19
- package/src/targets/php/http1/fixtures/multipart-data.php +0 -29
- package/src/targets/php/http1/fixtures/multipart-file.php +0 -25
- package/src/targets/php/http1/fixtures/multipart-form-data-no-params.php +0 -17
- package/src/targets/php/http1/fixtures/multipart-form-data.php +0 -24
- package/src/targets/php/http1/fixtures/nested.php +0 -19
- package/src/targets/php/http1/fixtures/query-encoded.php +0 -18
- package/src/targets/php/http1/fixtures/query.php +0 -22
- package/src/targets/php/http1/fixtures/short.php +0 -13
- package/src/targets/php/http1/fixtures/text-plain.php +0 -19
- package/src/targets/php/http2/client.ts +0 -153
- package/src/targets/php/http2/fixtures/application-form-encoded.php +0 -23
- package/src/targets/php/http2/fixtures/application-json.php +0 -20
- package/src/targets/php/http2/fixtures/cookies.php +0 -17
- package/src/targets/php/http2/fixtures/custom-method.php +0 -11
- package/src/targets/php/http2/fixtures/full.php +0 -38
- package/src/targets/php/http2/fixtures/headers.php +0 -17
- package/src/targets/php/http2/fixtures/http-insecure.php +0 -11
- package/src/targets/php/http2/fixtures/jsonObj-multiline.php +0 -22
- package/src/targets/php/http2/fixtures/jsonObj-null-value.php +0 -20
- package/src/targets/php/http2/fixtures/multipart-data.php +0 -25
- package/src/targets/php/http2/fixtures/multipart-file.php +0 -23
- package/src/targets/php/http2/fixtures/multipart-form-data-no-params.php +0 -15
- package/src/targets/php/http2/fixtures/multipart-form-data.php +0 -18
- package/src/targets/php/http2/fixtures/nested.php +0 -17
- package/src/targets/php/http2/fixtures/query-encoded.php +0 -16
- package/src/targets/php/http2/fixtures/query.php +0 -20
- package/src/targets/php/http2/fixtures/short.php +0 -11
- package/src/targets/php/http2/fixtures/text-plain.php +0 -20
- package/src/targets/php/target.ts +0 -21
- package/src/targets/powershell/common.ts +0 -58
- package/src/targets/powershell/restmethod/client.ts +0 -12
- package/src/targets/powershell/restmethod/fixtures/application-form-encoded.ps1 +0 -3
- package/src/targets/powershell/restmethod/fixtures/application-json.ps1 +0 -3
- package/src/targets/powershell/restmethod/fixtures/cookies.ps1 +0 -12
- package/src/targets/powershell/restmethod/fixtures/custom-method.ps1 +0 -1
- package/src/targets/powershell/restmethod/fixtures/full.ps1 +0 -15
- package/src/targets/powershell/restmethod/fixtures/headers.ps1 +0 -5
- package/src/targets/powershell/restmethod/fixtures/http-insecure.ps1 +0 -1
- package/src/targets/powershell/restmethod/fixtures/jsonObj-multiline.ps1 +0 -5
- package/src/targets/powershell/restmethod/fixtures/jsonObj-null-value.ps1 +0 -3
- package/src/targets/powershell/restmethod/fixtures/multipart-data.ps1 +0 -13
- package/src/targets/powershell/restmethod/fixtures/multipart-file.ps1 +0 -9
- package/src/targets/powershell/restmethod/fixtures/multipart-form-data-no-params.ps1 +0 -3
- package/src/targets/powershell/restmethod/fixtures/multipart-form-data.ps1 +0 -8
- package/src/targets/powershell/restmethod/fixtures/nested.ps1 +0 -1
- package/src/targets/powershell/restmethod/fixtures/query-encoded.ps1 +0 -1
- package/src/targets/powershell/restmethod/fixtures/query.ps1 +0 -1
- package/src/targets/powershell/restmethod/fixtures/short.ps1 +0 -1
- package/src/targets/powershell/restmethod/fixtures/text-plain.ps1 +0 -3
- package/src/targets/powershell/target.ts +0 -16
- package/src/targets/powershell/webrequest/client.ts +0 -12
- package/src/targets/powershell/webrequest/fixtures/application-form-encoded.ps1 +0 -3
- package/src/targets/powershell/webrequest/fixtures/application-json.ps1 +0 -3
- package/src/targets/powershell/webrequest/fixtures/cookies.ps1 +0 -12
- package/src/targets/powershell/webrequest/fixtures/custom-method.ps1 +0 -1
- package/src/targets/powershell/webrequest/fixtures/full.ps1 +0 -15
- package/src/targets/powershell/webrequest/fixtures/headers.ps1 +0 -5
- package/src/targets/powershell/webrequest/fixtures/http-insecure.ps1 +0 -1
- package/src/targets/powershell/webrequest/fixtures/jsonObj-multiline.ps1 +0 -5
- package/src/targets/powershell/webrequest/fixtures/jsonObj-null-value.ps1 +0 -3
- package/src/targets/powershell/webrequest/fixtures/multipart-data.ps1 +0 -13
- package/src/targets/powershell/webrequest/fixtures/multipart-file.ps1 +0 -9
- package/src/targets/powershell/webrequest/fixtures/multipart-form-data-no-params.ps1 +0 -3
- package/src/targets/powershell/webrequest/fixtures/multipart-form-data.ps1 +0 -8
- package/src/targets/powershell/webrequest/fixtures/nested.ps1 +0 -1
- package/src/targets/powershell/webrequest/fixtures/query-encoded.ps1 +0 -1
- package/src/targets/powershell/webrequest/fixtures/query.ps1 +0 -1
- package/src/targets/powershell/webrequest/fixtures/short.ps1 +0 -1
- package/src/targets/powershell/webrequest/fixtures/text-plain.ps1 +0 -3
- package/src/targets/python/helpers.ts +0 -81
- package/src/targets/python/requests/client.ts +0 -175
- package/src/targets/python/requests/fixtures/application-form-encoded.py +0 -10
- package/src/targets/python/requests/fixtures/application-json.py +0 -17
- package/src/targets/python/requests/fixtures/cookies.py +0 -9
- package/src/targets/python/requests/fixtures/custom-method.py +0 -7
- package/src/targets/python/requests/fixtures/full.py +0 -14
- package/src/targets/python/requests/fixtures/headers.py +0 -13
- package/src/targets/python/requests/fixtures/http-insecure.py +0 -7
- package/src/targets/python/requests/fixtures/jsonObj-multiline.py +0 -10
- package/src/targets/python/requests/fixtures/jsonObj-null-value.py +0 -10
- package/src/targets/python/requests/fixtures/multipart-data.py +0 -10
- package/src/targets/python/requests/fixtures/multipart-file.py +0 -9
- package/src/targets/python/requests/fixtures/multipart-form-data-no-params.py +0 -9
- package/src/targets/python/requests/fixtures/multipart-form-data.py +0 -10
- package/src/targets/python/requests/fixtures/nested.py +0 -7
- package/src/targets/python/requests/fixtures/query-encoded.py +0 -7
- package/src/targets/python/requests/fixtures/query.py +0 -7
- package/src/targets/python/requests/fixtures/short.py +0 -7
- package/src/targets/python/requests/fixtures/text-plain.py +0 -10
- package/src/targets/python/target.ts +0 -15
- package/src/targets/r/httr/client.test.ts +0 -29
- package/src/targets/r/httr/client.ts +0 -146
- package/src/targets/r/httr/fixtures/application-form-encoded.r +0 -11
- package/src/targets/r/httr/fixtures/application-json.r +0 -11
- package/src/targets/r/httr/fixtures/cookies.r +0 -7
- package/src/targets/r/httr/fixtures/custom-method.r +0 -7
- package/src/targets/r/httr/fixtures/full.r +0 -16
- package/src/targets/r/httr/fixtures/headers.r +0 -7
- package/src/targets/r/httr/fixtures/http-insecure.r +0 -7
- package/src/targets/r/httr/fixtures/jsonObj-multiline.r +0 -11
- package/src/targets/r/httr/fixtures/jsonObj-null-value.r +0 -11
- package/src/targets/r/httr/fixtures/multipart-data.r +0 -11
- package/src/targets/r/httr/fixtures/multipart-file.r +0 -11
- package/src/targets/r/httr/fixtures/multipart-form-data-no-params.r +0 -9
- package/src/targets/r/httr/fixtures/multipart-form-data.r +0 -11
- package/src/targets/r/httr/fixtures/nested.r +0 -12
- package/src/targets/r/httr/fixtures/query-encoded.r +0 -12
- package/src/targets/r/httr/fixtures/query-two-params.r +0 -12
- package/src/targets/r/httr/fixtures/query.r +0 -12
- package/src/targets/r/httr/fixtures/short.r +0 -7
- package/src/targets/r/httr/fixtures/text-plain.r +0 -11
- package/src/targets/r/target.ts +0 -14
- package/src/targets/ruby/native/client.ts +0 -78
- package/src/targets/ruby/native/fixtures/application-form-encoded.rb +0 -15
- package/src/targets/ruby/native/fixtures/application-json.rb +0 -15
- package/src/targets/ruby/native/fixtures/cookies.rb +0 -14
- package/src/targets/ruby/native/fixtures/custom-method.rb +0 -19
- package/src/targets/ruby/native/fixtures/full.rb +0 -17
- package/src/targets/ruby/native/fixtures/headers.rb +0 -16
- package/src/targets/ruby/native/fixtures/http-insecure.rb +0 -11
- package/src/targets/ruby/native/fixtures/jsonObj-multiline.rb +0 -15
- package/src/targets/ruby/native/fixtures/jsonObj-null-value.rb +0 -15
- package/src/targets/ruby/native/fixtures/multipart-data.rb +0 -15
- package/src/targets/ruby/native/fixtures/multipart-file.rb +0 -15
- package/src/targets/ruby/native/fixtures/multipart-form-data-no-params.rb +0 -14
- package/src/targets/ruby/native/fixtures/multipart-form-data.rb +0 -15
- package/src/targets/ruby/native/fixtures/nested.rb +0 -13
- package/src/targets/ruby/native/fixtures/query-encoded.rb +0 -13
- package/src/targets/ruby/native/fixtures/query.rb +0 -13
- package/src/targets/ruby/native/fixtures/short.rb +0 -13
- package/src/targets/ruby/native/fixtures/text-plain.rb +0 -15
- package/src/targets/ruby/target.ts +0 -14
- package/src/targets/shell/curl/client.test.ts +0 -157
- package/src/targets/shell/curl/client.ts +0 -193
- package/src/targets/shell/curl/fixtures/application-form-encoded.sh +0 -5
- package/src/targets/shell/curl/fixtures/application-json.sh +0 -25
- package/src/targets/shell/curl/fixtures/binary-option.sh +0 -1
- package/src/targets/shell/curl/fixtures/cookies.sh +0 -3
- package/src/targets/shell/curl/fixtures/custom-indentation.sh +0 -6
- package/src/targets/shell/curl/fixtures/custom-method.sh +0 -2
- package/src/targets/shell/curl/fixtures/dont-deglob.sh +0 -1
- package/src/targets/shell/curl/fixtures/full.sh +0 -6
- package/src/targets/shell/curl/fixtures/globoff-option.sh +0 -1
- package/src/targets/shell/curl/fixtures/harIsAlreadyEncoded-option-already-encoded.sh +0 -3
- package/src/targets/shell/curl/fixtures/harIsAlreadyEncoded=option-escape-brackets.sh +0 -2
- package/src/targets/shell/curl/fixtures/headers.sh +0 -5
- package/src/targets/shell/curl/fixtures/heredoc-json-encoded-data.sh +0 -9
- package/src/targets/shell/curl/fixtures/http-insecure.sh +0 -2
- package/src/targets/shell/curl/fixtures/http1.sh +0 -3
- package/src/targets/shell/curl/fixtures/http10.sh +0 -1
- package/src/targets/shell/curl/fixtures/json-payloads-smaller-than-20-characters.sh +0 -4
- package/src/targets/shell/curl/fixtures/jsonObj-multiline.sh +0 -6
- package/src/targets/shell/curl/fixtures/jsonObj-null-value.sh +0 -4
- package/src/targets/shell/curl/fixtures/long-globoff-option.sh +0 -1
- package/src/targets/shell/curl/fixtures/multipart-data.sh +0 -5
- package/src/targets/shell/curl/fixtures/multipart-file.sh +0 -4
- package/src/targets/shell/curl/fixtures/multipart-form-data-no-params.sh +0 -3
- package/src/targets/shell/curl/fixtures/multipart-form-data.sh +0 -4
- package/src/targets/shell/curl/fixtures/nested.sh +0 -2
- package/src/targets/shell/curl/fixtures/query-encoded.sh +0 -2
- package/src/targets/shell/curl/fixtures/query.sh +0 -2
- package/src/targets/shell/curl/fixtures/short-options.sh +0 -1
- package/src/targets/shell/curl/fixtures/short.sh +0 -2
- package/src/targets/shell/curl/fixtures/text-plain.sh +0 -4
- package/src/targets/shell/curl/fixtures/urlencode.sh +0 -5
- package/src/targets/shell/httpie/client.test.ts +0 -72
- package/src/targets/shell/httpie/client.ts +0 -144
- package/src/targets/shell/httpie/fixtures/application-form-encoded.sh +0 -4
- package/src/targets/shell/httpie/fixtures/application-json.sh +0 -3
- package/src/targets/shell/httpie/fixtures/build-parameters.sh +0 -1
- package/src/targets/shell/httpie/fixtures/cookies.sh +0 -2
- package/src/targets/shell/httpie/fixtures/custom-indentation.sh +0 -5
- package/src/targets/shell/httpie/fixtures/custom-method.sh +0 -1
- package/src/targets/shell/httpie/fixtures/full.sh +0 -5
- package/src/targets/shell/httpie/fixtures/headers.sh +0 -4
- package/src/targets/shell/httpie/fixtures/http-insecure.sh +0 -1
- package/src/targets/shell/httpie/fixtures/jsonObj-multiline.sh +0 -5
- package/src/targets/shell/httpie/fixtures/jsonObj-null-value.sh +0 -3
- package/src/targets/shell/httpie/fixtures/long-flags.sh +0 -1
- package/src/targets/shell/httpie/fixtures/multipart-data.sh +0 -13
- package/src/targets/shell/httpie/fixtures/multipart-file.sh +0 -9
- package/src/targets/shell/httpie/fixtures/multipart-form-data-no-params.sh +0 -2
- package/src/targets/shell/httpie/fixtures/multipart-form-data.sh +0 -8
- package/src/targets/shell/httpie/fixtures/nested.sh +0 -1
- package/src/targets/shell/httpie/fixtures/query-encoded.sh +0 -1
- package/src/targets/shell/httpie/fixtures/query.sh +0 -1
- package/src/targets/shell/httpie/fixtures/querystring-parameters.sh +0 -1
- package/src/targets/shell/httpie/fixtures/short-flags.sh +0 -1
- package/src/targets/shell/httpie/fixtures/short.sh +0 -1
- package/src/targets/shell/httpie/fixtures/text-plain.sh +0 -3
- package/src/targets/shell/httpie/fixtures/verbose-output.sh +0 -1
- package/src/targets/shell/target.ts +0 -19
- package/src/targets/shell/wget/client.test.ts +0 -35
- package/src/targets/shell/wget/client.ts +0 -63
- package/src/targets/shell/wget/fixtures/application-form-encoded.sh +0 -6
- package/src/targets/shell/wget/fixtures/application-json.sh +0 -6
- package/src/targets/shell/wget/fixtures/cookies.sh +0 -5
- package/src/targets/shell/wget/fixtures/custom-indentation.sh +0 -8
- package/src/targets/shell/wget/fixtures/custom-method.sh +0 -4
- package/src/targets/shell/wget/fixtures/full.sh +0 -8
- package/src/targets/shell/wget/fixtures/headers.sh +0 -7
- package/src/targets/shell/wget/fixtures/http-insecure.sh +0 -4
- package/src/targets/shell/wget/fixtures/jsonObj-multiline.sh +0 -6
- package/src/targets/shell/wget/fixtures/jsonObj-null-value.sh +0 -6
- package/src/targets/shell/wget/fixtures/multipart-data.sh +0 -6
- package/src/targets/shell/wget/fixtures/multipart-file.sh +0 -6
- package/src/targets/shell/wget/fixtures/multipart-form-data-no-params.sh +0 -5
- package/src/targets/shell/wget/fixtures/multipart-form-data.sh +0 -6
- package/src/targets/shell/wget/fixtures/nested.sh +0 -4
- package/src/targets/shell/wget/fixtures/query-encoded.sh +0 -4
- package/src/targets/shell/wget/fixtures/query.sh +0 -4
- package/src/targets/shell/wget/fixtures/short-options.sh +0 -1
- package/src/targets/shell/wget/fixtures/short.sh +0 -4
- package/src/targets/shell/wget/fixtures/text-plain.sh +0 -6
- package/src/targets/shell/wget/fixtures/v-output.sh +0 -1
- package/src/targets/shell/wget/fixtures/verbose-output.sh +0 -1
- package/src/targets/swift/helpers.ts +0 -86
- package/src/targets/swift/nsurlsession/client.test.ts +0 -44
- package/src/targets/swift/nsurlsession/client.ts +0 -157
- package/src/targets/swift/nsurlsession/fixtures/application-form-encoded.swift +0 -25
- package/src/targets/swift/nsurlsession/fixtures/application-json.swift +0 -32
- package/src/targets/swift/nsurlsession/fixtures/cookies.swift +0 -21
- package/src/targets/swift/nsurlsession/fixtures/custom-method.swift +0 -18
- package/src/targets/swift/nsurlsession/fixtures/full.swift +0 -28
- package/src/targets/swift/nsurlsession/fixtures/headers.swift +0 -25
- package/src/targets/swift/nsurlsession/fixtures/http-insecure.swift +0 -18
- package/src/targets/swift/nsurlsession/fixtures/indent-option.swift +0 -18
- package/src/targets/swift/nsurlsession/fixtures/json-null-value.swift +0 -25
- package/src/targets/swift/nsurlsession/fixtures/jsonObj-multiline.swift +0 -25
- package/src/targets/swift/nsurlsession/fixtures/jsonObj-null-value.swift +0 -25
- package/src/targets/swift/nsurlsession/fixtures/multipart-data.swift +0 -56
- package/src/targets/swift/nsurlsession/fixtures/multipart-file.swift +0 -51
- package/src/targets/swift/nsurlsession/fixtures/multipart-form-data-no-params.swift +0 -21
- package/src/targets/swift/nsurlsession/fixtures/multipart-form-data.swift +0 -50
- package/src/targets/swift/nsurlsession/fixtures/nested.swift +0 -18
- package/src/targets/swift/nsurlsession/fixtures/pretty-option.swift +0 -24
- package/src/targets/swift/nsurlsession/fixtures/query-encoded.swift +0 -18
- package/src/targets/swift/nsurlsession/fixtures/query.swift +0 -18
- package/src/targets/swift/nsurlsession/fixtures/short.swift +0 -18
- package/src/targets/swift/nsurlsession/fixtures/text-plain.swift +0 -24
- package/src/targets/swift/nsurlsession/fixtures/timeout-option.swift +0 -18
- package/src/targets/swift/target.ts +0 -14
- package/src/targets/targets.test.ts +0 -297
- package/src/targets/targets.ts +0 -203
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @description
|
|
4
|
+
* HTTP code snippet generator for Objective-C using NSURLSession.
|
|
5
|
+
*
|
|
6
|
+
* @author
|
|
7
|
+
* @thibaultCha
|
|
8
|
+
*
|
|
9
|
+
* for any questions or issues regarding the generated code snippet, please open an issue mentioning the author.
|
|
10
|
+
*/
|
|
11
|
+
var __assign = (this && this.__assign) || function () {
|
|
12
|
+
__assign = Object.assign || function(t) {
|
|
13
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
14
|
+
s = arguments[i];
|
|
15
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
16
|
+
t[p] = s[p];
|
|
17
|
+
}
|
|
18
|
+
return t;
|
|
19
|
+
};
|
|
20
|
+
return __assign.apply(this, arguments);
|
|
21
|
+
};
|
|
22
|
+
var __read = (this && this.__read) || function (o, n) {
|
|
23
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
24
|
+
if (!m) return o;
|
|
25
|
+
var i = m.call(o), r, ar = [], e;
|
|
26
|
+
try {
|
|
27
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
28
|
+
}
|
|
29
|
+
catch (error) { e = { error: error }; }
|
|
30
|
+
finally {
|
|
31
|
+
try {
|
|
32
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
33
|
+
}
|
|
34
|
+
finally { if (e) throw e.error; }
|
|
35
|
+
}
|
|
36
|
+
return ar;
|
|
37
|
+
};
|
|
38
|
+
exports.__esModule = true;
|
|
39
|
+
exports.nsurlsession = void 0;
|
|
40
|
+
var code_builder_1 = require("../../../helpers/code-builder");
|
|
41
|
+
var helpers_1 = require("../helpers");
|
|
42
|
+
exports.nsurlsession = {
|
|
43
|
+
info: {
|
|
44
|
+
key: 'nsurlsession',
|
|
45
|
+
title: 'NSURLSession',
|
|
46
|
+
link: 'https://developer.apple.com/library/mac/documentation/Foundation/Reference/NSURLSession_class/index.html',
|
|
47
|
+
description: "Foundation's NSURLSession request"
|
|
48
|
+
},
|
|
49
|
+
convert: function (_a, options) {
|
|
50
|
+
var allHeaders = _a.allHeaders, postData = _a.postData, method = _a.method, fullUrl = _a.fullUrl;
|
|
51
|
+
var opts = __assign({ indent: ' ', pretty: true, timeout: 10 }, options);
|
|
52
|
+
var _b = new code_builder_1.CodeBuilder({ indent: opts.indent }), push = _b.push, join = _b.join, blank = _b.blank;
|
|
53
|
+
// Markers for headers to be created as literal objects and later be set on the NSURLRequest if exist
|
|
54
|
+
var req = {
|
|
55
|
+
hasHeaders: false,
|
|
56
|
+
hasBody: false
|
|
57
|
+
};
|
|
58
|
+
// We just want to make sure people understand that is the only dependency
|
|
59
|
+
push('#import <Foundation/Foundation.h>');
|
|
60
|
+
if (Object.keys(allHeaders).length) {
|
|
61
|
+
req.hasHeaders = true;
|
|
62
|
+
blank();
|
|
63
|
+
push((0, helpers_1.nsDeclaration)('NSDictionary', 'headers', allHeaders, opts.pretty));
|
|
64
|
+
}
|
|
65
|
+
if (postData.text || postData.jsonObj || postData.params) {
|
|
66
|
+
req.hasBody = true;
|
|
67
|
+
switch (postData.mimeType) {
|
|
68
|
+
case 'application/x-www-form-urlencoded':
|
|
69
|
+
if (postData.params) {
|
|
70
|
+
// By appending parameters one by one in the resulting snippet,
|
|
71
|
+
// we make it easier for the user to edit it according to his or her needs after pasting.
|
|
72
|
+
// The user can just add/remove lines adding/removing body parameters.
|
|
73
|
+
blank();
|
|
74
|
+
var _c = __read(postData.params), head = _c[0], tail = _c.slice(1);
|
|
75
|
+
push("NSMutableData *postData = [[NSMutableData alloc] initWithData:[@\"".concat(head.name, "=").concat(head.value, "\" dataUsingEncoding:NSUTF8StringEncoding]];"));
|
|
76
|
+
tail.forEach(function (_a) {
|
|
77
|
+
var name = _a.name, value = _a.value;
|
|
78
|
+
push("[postData appendData:[@\"&".concat(name, "=").concat(value, "\" dataUsingEncoding:NSUTF8StringEncoding]];"));
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
else {
|
|
82
|
+
req.hasBody = false;
|
|
83
|
+
}
|
|
84
|
+
break;
|
|
85
|
+
case 'application/json':
|
|
86
|
+
if (postData.jsonObj) {
|
|
87
|
+
push((0, helpers_1.nsDeclaration)('NSDictionary', 'parameters', postData.jsonObj, opts.pretty));
|
|
88
|
+
blank();
|
|
89
|
+
push('NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];');
|
|
90
|
+
}
|
|
91
|
+
break;
|
|
92
|
+
case 'multipart/form-data':
|
|
93
|
+
// By appending multipart parameters one by one in the resulting snippet,
|
|
94
|
+
// we make it easier for the user to edit it according to his or her needs after pasting.
|
|
95
|
+
// The user can just edit the parameters NSDictionary or put this part of a snippet in a multipart builder method.
|
|
96
|
+
push((0, helpers_1.nsDeclaration)('NSArray', 'parameters', postData.params || [], opts.pretty));
|
|
97
|
+
push("NSString *boundary = @\"".concat(postData.boundary, "\";"));
|
|
98
|
+
blank();
|
|
99
|
+
push('NSError *error;');
|
|
100
|
+
push('NSMutableString *body = [NSMutableString string];');
|
|
101
|
+
push('for (NSDictionary *param in parameters) {');
|
|
102
|
+
push('[body appendFormat:@"--%@\\r\\n", boundary];', 1);
|
|
103
|
+
push('if (param[@"fileName"]) {', 1);
|
|
104
|
+
push('[body appendFormat:@"Content-Disposition:form-data; name=\\"%@\\"; filename=\\"%@\\"\\r\\n", param[@"name"], param[@"fileName"]];', 2);
|
|
105
|
+
push('[body appendFormat:@"Content-Type: %@\\r\\n\\r\\n", param[@"contentType"]];', 2);
|
|
106
|
+
push('[body appendFormat:@"%@", [NSString stringWithContentsOfFile:param[@"fileName"] encoding:NSUTF8StringEncoding error:&error]];', 2);
|
|
107
|
+
push('if (error) {', 2);
|
|
108
|
+
push('NSLog(@"%@", error);', 3);
|
|
109
|
+
push('}', 2);
|
|
110
|
+
push('} else {', 1);
|
|
111
|
+
push('[body appendFormat:@"Content-Disposition:form-data; name=\\"%@\\"\\r\\n\\r\\n", param[@"name"]];', 2);
|
|
112
|
+
push('[body appendFormat:@"%@", param[@"value"]];', 2);
|
|
113
|
+
push('}', 1);
|
|
114
|
+
push('}');
|
|
115
|
+
push('[body appendFormat:@"\\r\\n--%@--\\r\\n", boundary];');
|
|
116
|
+
push('NSData *postData = [body dataUsingEncoding:NSUTF8StringEncoding];');
|
|
117
|
+
break;
|
|
118
|
+
default:
|
|
119
|
+
blank();
|
|
120
|
+
push("NSData *postData = [[NSData alloc] initWithData:[@\"".concat(postData.text, "\" dataUsingEncoding:NSUTF8StringEncoding]];"));
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
blank();
|
|
124
|
+
push("NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@\"".concat(fullUrl, "\"]"));
|
|
125
|
+
// NSURLRequestUseProtocolCachePolicy is the default policy, let's just always set it to avoid confusion.
|
|
126
|
+
push(' cachePolicy:NSURLRequestUseProtocolCachePolicy');
|
|
127
|
+
push(" timeoutInterval:".concat(opts.timeout.toFixed(1), "];"));
|
|
128
|
+
push("[request setHTTPMethod:@\"".concat(method, "\"];"));
|
|
129
|
+
if (req.hasHeaders) {
|
|
130
|
+
push('[request setAllHTTPHeaderFields:headers];');
|
|
131
|
+
}
|
|
132
|
+
if (req.hasBody) {
|
|
133
|
+
push('[request setHTTPBody:postData];');
|
|
134
|
+
}
|
|
135
|
+
blank();
|
|
136
|
+
// Retrieving the shared session will be less verbose than creating a new one.
|
|
137
|
+
push('NSURLSession *session = [NSURLSession sharedSession];');
|
|
138
|
+
push('NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request');
|
|
139
|
+
push(' completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {');
|
|
140
|
+
push(' if (error) {', 1);
|
|
141
|
+
push(' NSLog(@"%@", error);', 2);
|
|
142
|
+
push(' } else {', 1);
|
|
143
|
+
// Casting the NSURLResponse to NSHTTPURLResponse so the user can see the status .
|
|
144
|
+
push(' NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;', 2);
|
|
145
|
+
push(' NSLog(@"%@", httpResponse);', 2);
|
|
146
|
+
push(' }', 1);
|
|
147
|
+
push(' }];');
|
|
148
|
+
push('[dataTask resume];');
|
|
149
|
+
return join();
|
|
150
|
+
}
|
|
151
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
exports.__esModule = 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
|
+
};
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @description
|
|
4
|
+
* HTTP code snippet generator for OCaml using CoHTTP.
|
|
5
|
+
*
|
|
6
|
+
* @author
|
|
7
|
+
* @SGrondin
|
|
8
|
+
*
|
|
9
|
+
* for any questions or issues regarding the generated code snippet, please open an issue mentioning the author.
|
|
10
|
+
*/
|
|
11
|
+
var __assign = (this && this.__assign) || function () {
|
|
12
|
+
__assign = Object.assign || function(t) {
|
|
13
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
14
|
+
s = arguments[i];
|
|
15
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
16
|
+
t[p] = s[p];
|
|
17
|
+
}
|
|
18
|
+
return t;
|
|
19
|
+
};
|
|
20
|
+
return __assign.apply(this, arguments);
|
|
21
|
+
};
|
|
22
|
+
exports.__esModule = true;
|
|
23
|
+
exports.cohttp = void 0;
|
|
24
|
+
var code_builder_1 = require("../../../helpers/code-builder");
|
|
25
|
+
exports.cohttp = {
|
|
26
|
+
info: {
|
|
27
|
+
key: 'cohttp',
|
|
28
|
+
title: 'CoHTTP',
|
|
29
|
+
link: 'https://github.com/mirage/ocaml-cohttp',
|
|
30
|
+
description: 'Cohttp is a very lightweight HTTP server using Lwt or Async for OCaml'
|
|
31
|
+
},
|
|
32
|
+
convert: function (_a, options) {
|
|
33
|
+
var fullUrl = _a.fullUrl, allHeaders = _a.allHeaders, postData = _a.postData, method = _a.method;
|
|
34
|
+
var opts = __assign({ indent: ' ' }, options);
|
|
35
|
+
var methods = ['get', 'post', 'head', 'delete', 'patch', 'put', 'options'];
|
|
36
|
+
var _b = new code_builder_1.CodeBuilder({ indent: opts.indent }), push = _b.push, blank = _b.blank, join = _b.join;
|
|
37
|
+
push('open Cohttp_lwt_unix');
|
|
38
|
+
push('open Cohttp');
|
|
39
|
+
push('open Lwt');
|
|
40
|
+
blank();
|
|
41
|
+
push("let uri = Uri.of_string \"".concat(fullUrl, "\" in"));
|
|
42
|
+
// Add headers, including the cookies
|
|
43
|
+
var headers = Object.keys(allHeaders);
|
|
44
|
+
if (headers.length === 1) {
|
|
45
|
+
push("let headers = Header.add (Header.init ()) \"".concat(headers[0], "\" \"").concat(allHeaders[headers[0]], "\" in"));
|
|
46
|
+
}
|
|
47
|
+
else if (headers.length > 1) {
|
|
48
|
+
push('let headers = Header.add_list (Header.init ()) [');
|
|
49
|
+
headers.forEach(function (key) {
|
|
50
|
+
push("(\"".concat(key, "\", \"").concat(allHeaders[key], "\");"), 1);
|
|
51
|
+
});
|
|
52
|
+
push('] in');
|
|
53
|
+
}
|
|
54
|
+
// Add body
|
|
55
|
+
if (postData.text) {
|
|
56
|
+
// Just text
|
|
57
|
+
push("let body = Cohttp_lwt_body.of_string ".concat(JSON.stringify(postData.text), " in"));
|
|
58
|
+
}
|
|
59
|
+
// Do the request
|
|
60
|
+
blank();
|
|
61
|
+
var h = headers.length ? '~headers ' : '';
|
|
62
|
+
var b = postData.text ? '~body ' : '';
|
|
63
|
+
var m = methods.includes(method.toLowerCase())
|
|
64
|
+
? "`".concat(method.toUpperCase())
|
|
65
|
+
: "(Code.method_of_string \"".concat(method, "\")");
|
|
66
|
+
push("Client.call ".concat(h).concat(b).concat(m, " uri"));
|
|
67
|
+
// Catch result
|
|
68
|
+
push('>>= fun (res, body_stream) ->');
|
|
69
|
+
push('(* Do stuff with the result *)', 1);
|
|
70
|
+
return join();
|
|
71
|
+
}
|
|
72
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
exports.__esModule = true;
|
|
3
|
+
exports.ocaml = void 0;
|
|
4
|
+
var client_1 = require("./cohttp/client");
|
|
5
|
+
exports.ocaml = {
|
|
6
|
+
info: {
|
|
7
|
+
key: 'ocaml',
|
|
8
|
+
title: 'OCaml',
|
|
9
|
+
extname: '.ml',
|
|
10
|
+
"default": 'cohttp'
|
|
11
|
+
},
|
|
12
|
+
clientsById: {
|
|
13
|
+
cohttp: client_1.cohttp
|
|
14
|
+
}
|
|
15
|
+
};
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @description
|
|
4
|
+
* HTTP code snippet generator for PHP using curl-ext.
|
|
5
|
+
*
|
|
6
|
+
* @author
|
|
7
|
+
* @AhmadNassri
|
|
8
|
+
*
|
|
9
|
+
* for any questions or issues regarding the generated code snippet, please open an issue mentioning the author.
|
|
10
|
+
*/
|
|
11
|
+
var __assign = (this && this.__assign) || function () {
|
|
12
|
+
__assign = Object.assign || function(t) {
|
|
13
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
14
|
+
s = arguments[i];
|
|
15
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
16
|
+
t[p] = s[p];
|
|
17
|
+
}
|
|
18
|
+
return t;
|
|
19
|
+
};
|
|
20
|
+
return __assign.apply(this, arguments);
|
|
21
|
+
};
|
|
22
|
+
exports.__esModule = true;
|
|
23
|
+
exports.curl = void 0;
|
|
24
|
+
var code_builder_1 = require("../../../helpers/code-builder");
|
|
25
|
+
exports.curl = {
|
|
26
|
+
info: {
|
|
27
|
+
key: 'curl',
|
|
28
|
+
title: 'cURL',
|
|
29
|
+
link: 'http://php.net/manual/en/book.curl.php',
|
|
30
|
+
description: 'PHP with ext-curl'
|
|
31
|
+
},
|
|
32
|
+
convert: function (_a, options) {
|
|
33
|
+
var uriObj = _a.uriObj, postData = _a.postData, fullUrl = _a.fullUrl, method = _a.method, httpVersion = _a.httpVersion, cookies = _a.cookies, headersObj = _a.headersObj;
|
|
34
|
+
var opts = __assign({ closingTag: false, indent: ' ', maxRedirects: 10, namedErrors: false, noTags: false, shortTags: false, timeout: 30 }, options);
|
|
35
|
+
var _b = new code_builder_1.CodeBuilder({ indent: opts.indent }), push = _b.push, blank = _b.blank, join = _b.join;
|
|
36
|
+
if (!opts.noTags) {
|
|
37
|
+
push(opts.shortTags ? '<?' : '<?php');
|
|
38
|
+
blank();
|
|
39
|
+
}
|
|
40
|
+
push('$curl = curl_init();');
|
|
41
|
+
blank();
|
|
42
|
+
var curlOptions = [
|
|
43
|
+
{
|
|
44
|
+
escape: true,
|
|
45
|
+
name: 'CURLOPT_PORT',
|
|
46
|
+
value: uriObj.port
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
escape: true,
|
|
50
|
+
name: 'CURLOPT_URL',
|
|
51
|
+
value: fullUrl
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
escape: false,
|
|
55
|
+
name: 'CURLOPT_RETURNTRANSFER',
|
|
56
|
+
value: 'true'
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
escape: true,
|
|
60
|
+
name: 'CURLOPT_ENCODING',
|
|
61
|
+
value: ''
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
escape: false,
|
|
65
|
+
name: 'CURLOPT_MAXREDIRS',
|
|
66
|
+
value: opts.maxRedirects
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
escape: false,
|
|
70
|
+
name: 'CURLOPT_TIMEOUT',
|
|
71
|
+
value: opts.timeout
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
escape: false,
|
|
75
|
+
name: 'CURLOPT_HTTP_VERSION',
|
|
76
|
+
value: httpVersion === 'HTTP/1.0' ? 'CURL_HTTP_VERSION_1_0' : 'CURL_HTTP_VERSION_1_1'
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
escape: true,
|
|
80
|
+
name: 'CURLOPT_CUSTOMREQUEST',
|
|
81
|
+
value: method
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
escape: true,
|
|
85
|
+
name: 'CURLOPT_POSTFIELDS',
|
|
86
|
+
value: postData ? postData.text : undefined
|
|
87
|
+
},
|
|
88
|
+
];
|
|
89
|
+
push('curl_setopt_array($curl, [');
|
|
90
|
+
var curlopts = new code_builder_1.CodeBuilder({ indent: opts.indent, join: "\n".concat(opts.indent) });
|
|
91
|
+
curlOptions.forEach(function (_a) {
|
|
92
|
+
var value = _a.value, name = _a.name, escape = _a.escape;
|
|
93
|
+
if (value !== null && value !== undefined) {
|
|
94
|
+
curlopts.push("".concat(name, " => ").concat(escape ? JSON.stringify(value) : value, ","));
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
// construct cookies
|
|
98
|
+
var curlCookies = cookies.map(function (cookie) { return "".concat(encodeURIComponent(cookie.name), "=").concat(encodeURIComponent(cookie.value)); });
|
|
99
|
+
if (curlCookies.length) {
|
|
100
|
+
curlopts.push("CURLOPT_COOKIE => \"".concat(curlCookies.join('; '), "\","));
|
|
101
|
+
}
|
|
102
|
+
// construct cookies
|
|
103
|
+
var headers = Object.keys(headersObj)
|
|
104
|
+
.sort()
|
|
105
|
+
.map(function (key) { return "\"".concat(key, ": ").concat(headersObj[key], "\""); });
|
|
106
|
+
if (headers.length) {
|
|
107
|
+
curlopts.push('CURLOPT_HTTPHEADER => [');
|
|
108
|
+
curlopts.push(headers.join(",\n".concat(opts.indent).concat(opts.indent)), 1);
|
|
109
|
+
curlopts.push('],');
|
|
110
|
+
}
|
|
111
|
+
push(curlopts.join(), 1);
|
|
112
|
+
push(']);');
|
|
113
|
+
blank();
|
|
114
|
+
push('$response = curl_exec($curl);');
|
|
115
|
+
push('$err = curl_error($curl);');
|
|
116
|
+
blank();
|
|
117
|
+
push('curl_close($curl);');
|
|
118
|
+
blank();
|
|
119
|
+
push('if ($err) {');
|
|
120
|
+
if (opts.namedErrors) {
|
|
121
|
+
push('echo array_flip(get_defined_constants(true)["curl"])[$err];', 1);
|
|
122
|
+
}
|
|
123
|
+
else {
|
|
124
|
+
push('echo "cURL Error #:" . $err;', 1);
|
|
125
|
+
}
|
|
126
|
+
push('} else {');
|
|
127
|
+
push('echo $response;', 1);
|
|
128
|
+
push('}');
|
|
129
|
+
if (!opts.noTags && opts.closingTag) {
|
|
130
|
+
blank();
|
|
131
|
+
push('?>');
|
|
132
|
+
}
|
|
133
|
+
return join();
|
|
134
|
+
}
|
|
135
|
+
};
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @description
|
|
4
|
+
* HTTP code snippet generator for PHP using Guzzle.
|
|
5
|
+
*
|
|
6
|
+
* @author @RobertoArruda
|
|
7
|
+
* @author @erunion
|
|
8
|
+
*
|
|
9
|
+
* for any questions or issues regarding the generated code snippet, please open an issue mentioning the author.
|
|
10
|
+
*/
|
|
11
|
+
var __assign = (this && this.__assign) || function () {
|
|
12
|
+
__assign = Object.assign || function(t) {
|
|
13
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
14
|
+
s = arguments[i];
|
|
15
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
16
|
+
t[p] = s[p];
|
|
17
|
+
}
|
|
18
|
+
return t;
|
|
19
|
+
};
|
|
20
|
+
return __assign.apply(this, arguments);
|
|
21
|
+
};
|
|
22
|
+
exports.__esModule = true;
|
|
23
|
+
exports.guzzle = void 0;
|
|
24
|
+
var code_builder_1 = require("../../../helpers/code-builder");
|
|
25
|
+
var headers_1 = require("../../../helpers/headers");
|
|
26
|
+
var helpers_1 = require("../helpers");
|
|
27
|
+
exports.guzzle = {
|
|
28
|
+
info: {
|
|
29
|
+
key: 'guzzle',
|
|
30
|
+
title: 'Guzzle',
|
|
31
|
+
link: 'http://docs.guzzlephp.org/en/stable/',
|
|
32
|
+
description: 'PHP with Guzzle'
|
|
33
|
+
},
|
|
34
|
+
convert: function (_a, options) {
|
|
35
|
+
var postData = _a.postData, fullUrl = _a.fullUrl, method = _a.method, cookies = _a.cookies, headersObj = _a.headersObj;
|
|
36
|
+
var opts = __assign({ closingTag: false, indent: ' ', noTags: false, shortTags: false }, options);
|
|
37
|
+
var _b = new code_builder_1.CodeBuilder({ indent: opts.indent }), push = _b.push, blank = _b.blank, join = _b.join;
|
|
38
|
+
var _c = new code_builder_1.CodeBuilder({ indent: opts.indent }), requestCode = _c.code, requestPush = _c.push, requestJoin = _c.join;
|
|
39
|
+
if (!opts.noTags) {
|
|
40
|
+
push(opts.shortTags ? '<?' : '<?php');
|
|
41
|
+
}
|
|
42
|
+
push("require_once('vendor/autoload.php');");
|
|
43
|
+
blank();
|
|
44
|
+
switch (postData.mimeType) {
|
|
45
|
+
case 'application/x-www-form-urlencoded':
|
|
46
|
+
requestPush("'form_params' => ".concat((0, helpers_1.convertType)(postData.paramsObj, opts.indent + opts.indent, opts.indent), ","), 1);
|
|
47
|
+
break;
|
|
48
|
+
case 'multipart/form-data': {
|
|
49
|
+
var fields_1 = [];
|
|
50
|
+
if (postData.params) {
|
|
51
|
+
postData.params.forEach(function (param) {
|
|
52
|
+
if (param.fileName) {
|
|
53
|
+
var field = {
|
|
54
|
+
name: param.name,
|
|
55
|
+
filename: param.fileName,
|
|
56
|
+
contents: param.value
|
|
57
|
+
};
|
|
58
|
+
if (param.contentType) {
|
|
59
|
+
field.headers = { 'Content-Type': param.contentType };
|
|
60
|
+
}
|
|
61
|
+
fields_1.push(field);
|
|
62
|
+
}
|
|
63
|
+
else if (param.value) {
|
|
64
|
+
fields_1.push({
|
|
65
|
+
name: param.name,
|
|
66
|
+
contents: param.value
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
if (fields_1.length) {
|
|
72
|
+
requestPush("'multipart' => ".concat((0, helpers_1.convertType)(fields_1, opts.indent + opts.indent, opts.indent)), 1);
|
|
73
|
+
// Guzzle adds its own boundary for multipart requests.
|
|
74
|
+
if ((0, headers_1.hasHeader)(headersObj, 'content-type')) {
|
|
75
|
+
if (String((0, headers_1.getHeader)(headersObj, 'content-type')).indexOf('boundary')) {
|
|
76
|
+
var headerName = (0, headers_1.getHeaderName)(headersObj, 'content-type');
|
|
77
|
+
if (headerName) {
|
|
78
|
+
delete headersObj[headerName];
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
break;
|
|
84
|
+
}
|
|
85
|
+
default:
|
|
86
|
+
if (postData.text) {
|
|
87
|
+
requestPush("'body' => ".concat((0, helpers_1.convertType)(postData.text), ","), 1);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
// construct headers
|
|
91
|
+
var headers = Object.keys(headersObj)
|
|
92
|
+
.sort()
|
|
93
|
+
.map(function (key) {
|
|
94
|
+
return "".concat(opts.indent).concat(opts.indent, "'").concat(key, "' => '").concat(headersObj[key], "',");
|
|
95
|
+
});
|
|
96
|
+
// construct cookies
|
|
97
|
+
var cookieString = cookies
|
|
98
|
+
.map(function (cookie) { return "".concat(encodeURIComponent(cookie.name), "=").concat(encodeURIComponent(cookie.value)); })
|
|
99
|
+
.join('; ');
|
|
100
|
+
if (cookieString.length) {
|
|
101
|
+
headers.push("".concat(opts.indent).concat(opts.indent, "'cookie' => '").concat(cookieString, "',"));
|
|
102
|
+
}
|
|
103
|
+
if (headers.length) {
|
|
104
|
+
requestPush("'headers' => [", 1);
|
|
105
|
+
requestPush(headers.join('\n'));
|
|
106
|
+
requestPush('],', 1);
|
|
107
|
+
}
|
|
108
|
+
push('$client = new \\GuzzleHttp\\Client();');
|
|
109
|
+
blank();
|
|
110
|
+
if (requestCode.length) {
|
|
111
|
+
push("$response = $client->request('".concat(method, "', '").concat(fullUrl, "', ["));
|
|
112
|
+
push(requestJoin());
|
|
113
|
+
push(']);');
|
|
114
|
+
}
|
|
115
|
+
else {
|
|
116
|
+
push("$response = $client->request('".concat(method, "', '").concat(fullUrl, "');"));
|
|
117
|
+
}
|
|
118
|
+
blank();
|
|
119
|
+
push('echo $response->getBody();');
|
|
120
|
+
if (!opts.noTags && opts.closingTag) {
|
|
121
|
+
blank();
|
|
122
|
+
push('?>');
|
|
123
|
+
}
|
|
124
|
+
return join();
|
|
125
|
+
}
|
|
126
|
+
};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
exports.__esModule = true;
|
|
3
|
+
exports.supportedMethods = exports.convertType = void 0;
|
|
4
|
+
var convertType = function (obj, indent, lastIndent) {
|
|
5
|
+
lastIndent = lastIndent || '';
|
|
6
|
+
indent = indent || '';
|
|
7
|
+
switch (Object.prototype.toString.call(obj)) {
|
|
8
|
+
case '[object Null]':
|
|
9
|
+
return 'null';
|
|
10
|
+
case '[object Undefined]':
|
|
11
|
+
return 'null';
|
|
12
|
+
case '[object String]':
|
|
13
|
+
return "'".concat(obj.replace(/\\/g, '\\\\').replace(/'/g, "'"), "'");
|
|
14
|
+
case '[object Number]':
|
|
15
|
+
return obj.toString();
|
|
16
|
+
case '[object Array]': {
|
|
17
|
+
var contents = obj.map(function (item) { return (0, exports.convertType)(item, "".concat(indent).concat(indent), indent); }).join(",\n".concat(indent));
|
|
18
|
+
return "[\n".concat(indent).concat(contents, "\n").concat(lastIndent, "]");
|
|
19
|
+
}
|
|
20
|
+
case '[object Object]': {
|
|
21
|
+
var result = [];
|
|
22
|
+
// eslint-disable-next-line no-restricted-syntax
|
|
23
|
+
for (var i in obj) {
|
|
24
|
+
if (Object.prototype.hasOwnProperty.call(obj, i)) {
|
|
25
|
+
result.push("".concat((0, exports.convertType)(i, indent), " => ").concat((0, exports.convertType)(obj[i], "".concat(indent).concat(indent), indent)));
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
return "[\n".concat(indent).concat(result.join(",\n".concat(indent)), "\n").concat(lastIndent, "]");
|
|
29
|
+
}
|
|
30
|
+
default:
|
|
31
|
+
return 'null';
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
exports.convertType = convertType;
|
|
35
|
+
exports.supportedMethods = [
|
|
36
|
+
'ACL',
|
|
37
|
+
'BASELINE_CONTROL',
|
|
38
|
+
'CHECKIN',
|
|
39
|
+
'CHECKOUT',
|
|
40
|
+
'CONNECT',
|
|
41
|
+
'COPY',
|
|
42
|
+
'DELETE',
|
|
43
|
+
'GET',
|
|
44
|
+
'HEAD',
|
|
45
|
+
'LABEL',
|
|
46
|
+
'LOCK',
|
|
47
|
+
'MERGE',
|
|
48
|
+
'MKACTIVITY',
|
|
49
|
+
'MKCOL',
|
|
50
|
+
'MKWORKSPACE',
|
|
51
|
+
'MOVE',
|
|
52
|
+
'OPTIONS',
|
|
53
|
+
'POST',
|
|
54
|
+
'PROPFIND',
|
|
55
|
+
'PROPPATCH',
|
|
56
|
+
'PUT',
|
|
57
|
+
'REPORT',
|
|
58
|
+
'TRACE',
|
|
59
|
+
'UNCHECKOUT',
|
|
60
|
+
'UNLOCK',
|
|
61
|
+
'UPDATE',
|
|
62
|
+
'VERSION_CONTROL',
|
|
63
|
+
];
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @description
|
|
4
|
+
* HTTP code snippet generator for PHP using curl-ext.
|
|
5
|
+
*
|
|
6
|
+
* @author
|
|
7
|
+
* @AhmadNassri
|
|
8
|
+
*
|
|
9
|
+
* for any questions or issues regarding the generated code snippet, please open an issue mentioning the author.
|
|
10
|
+
*/
|
|
11
|
+
var __assign = (this && this.__assign) || function () {
|
|
12
|
+
__assign = Object.assign || function(t) {
|
|
13
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
14
|
+
s = arguments[i];
|
|
15
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
16
|
+
t[p] = s[p];
|
|
17
|
+
}
|
|
18
|
+
return t;
|
|
19
|
+
};
|
|
20
|
+
return __assign.apply(this, arguments);
|
|
21
|
+
};
|
|
22
|
+
exports.__esModule = true;
|
|
23
|
+
exports.http1 = void 0;
|
|
24
|
+
var code_builder_1 = require("../../../helpers/code-builder");
|
|
25
|
+
var helpers_1 = require("../helpers");
|
|
26
|
+
exports.http1 = {
|
|
27
|
+
info: {
|
|
28
|
+
key: 'http1',
|
|
29
|
+
title: 'HTTP v1',
|
|
30
|
+
link: 'http://php.net/manual/en/book.http.php',
|
|
31
|
+
description: 'PHP with pecl/http v1'
|
|
32
|
+
},
|
|
33
|
+
convert: function (_a, options) {
|
|
34
|
+
var method = _a.method, url = _a.url, postData = _a.postData, queryObj = _a.queryObj, headersObj = _a.headersObj, cookiesObj = _a.cookiesObj;
|
|
35
|
+
var opts = __assign({ closingTag: false, indent: ' ', noTags: false, shortTags: false }, options);
|
|
36
|
+
var _b = new code_builder_1.CodeBuilder({ indent: opts.indent }), push = _b.push, blank = _b.blank, join = _b.join;
|
|
37
|
+
if (!opts.noTags) {
|
|
38
|
+
push(opts.shortTags ? '<?' : '<?php');
|
|
39
|
+
blank();
|
|
40
|
+
}
|
|
41
|
+
if (!helpers_1.supportedMethods.includes(method.toUpperCase())) {
|
|
42
|
+
push("HttpRequest::methodRegister('".concat(method, "');"));
|
|
43
|
+
}
|
|
44
|
+
push('$request = new HttpRequest();');
|
|
45
|
+
push("$request->setUrl(".concat((0, helpers_1.convertType)(url), ");"));
|
|
46
|
+
if (helpers_1.supportedMethods.includes(method.toUpperCase())) {
|
|
47
|
+
push("$request->setMethod(HTTP_METH_".concat(method.toUpperCase(), ");"));
|
|
48
|
+
}
|
|
49
|
+
else {
|
|
50
|
+
push("$request->setMethod(HttpRequest::HTTP_METH_".concat(method.toUpperCase(), ");"));
|
|
51
|
+
}
|
|
52
|
+
blank();
|
|
53
|
+
if (Object.keys(queryObj).length) {
|
|
54
|
+
push("$request->setQueryData(".concat((0, helpers_1.convertType)(queryObj, opts.indent), ");"));
|
|
55
|
+
blank();
|
|
56
|
+
}
|
|
57
|
+
if (Object.keys(headersObj).length) {
|
|
58
|
+
push("$request->setHeaders(".concat((0, helpers_1.convertType)(headersObj, opts.indent), ");"));
|
|
59
|
+
blank();
|
|
60
|
+
}
|
|
61
|
+
if (Object.keys(cookiesObj).length) {
|
|
62
|
+
push("$request->setCookies(".concat((0, helpers_1.convertType)(cookiesObj, opts.indent), ");"));
|
|
63
|
+
blank();
|
|
64
|
+
}
|
|
65
|
+
switch (postData.mimeType) {
|
|
66
|
+
case 'application/x-www-form-urlencoded':
|
|
67
|
+
push("$request->setContentType(".concat((0, helpers_1.convertType)(postData.mimeType), ");"));
|
|
68
|
+
push("$request->setPostFields(".concat((0, helpers_1.convertType)(postData.paramsObj, opts.indent), ");"));
|
|
69
|
+
blank();
|
|
70
|
+
break;
|
|
71
|
+
default:
|
|
72
|
+
if (postData.text) {
|
|
73
|
+
push("$request->setBody(".concat((0, helpers_1.convertType)(postData.text), ");"));
|
|
74
|
+
blank();
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
push('try {');
|
|
78
|
+
push('$response = $request->send();', 1);
|
|
79
|
+
blank();
|
|
80
|
+
push('echo $response->getBody();', 1);
|
|
81
|
+
push('} catch (HttpException $ex) {');
|
|
82
|
+
push('echo $ex;', 1);
|
|
83
|
+
push('}');
|
|
84
|
+
if (!opts.noTags && opts.closingTag) {
|
|
85
|
+
blank();
|
|
86
|
+
push('?>');
|
|
87
|
+
}
|
|
88
|
+
return join();
|
|
89
|
+
}
|
|
90
|
+
};
|