@readme/httpsnippet 10.0.4 → 10.0.5

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/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { reducer } from './chunk-KT7MO6Z4.js';
2
- import { targets, getHeaderName } from './chunk-CSDAGXA2.js';
3
- export { addClientPlugin, addTarget, addTargetClient } from './chunk-CSDAGXA2.js';
2
+ import { targets, getHeaderName } from './chunk-QBICEG2V.js';
3
+ export { addClientPlugin, addTarget, addTargetClient } from './chunk-QBICEG2V.js';
4
4
  import './chunk-Y7NI4MMY.js';
5
5
  import { parse, format } from 'url';
6
6
  import { stringify } from 'qs';
@@ -3318,7 +3318,7 @@ var urlsession = {
3318
3318
  break;
3319
3319
  case "application/json":
3320
3320
  if (postData.jsonObj) {
3321
- push(`${literalDeclaration("parameters", postData.jsonObj, opts)} as [String : Any]`);
3321
+ push(`${literalDeclaration("parameters", postData.jsonObj, opts)} as [String : Any?]`);
3322
3322
  blank();
3323
3323
  push("let postData = try JSONSerialization.data(withJSONObject: parameters, options: [])");
3324
3324
  blank();
@@ -3335,7 +3335,7 @@ var urlsession = {
3335
3335
  push('body += "--\\(boundary)\\r\\n"', 1);
3336
3336
  push('body += "Content-Disposition:form-data; name=\\"\\(paramName)\\""', 1);
3337
3337
  push('if let filename = param["fileName"] {', 1);
3338
- push('let contentType = param["content-type"]!', 2);
3338
+ push('let contentType = param["contentType"]!', 2);
3339
3339
  push("let fileContent = try String(contentsOfFile: filename, encoding: .utf8)", 2);
3340
3340
  push('body += "; filename=\\"\\(filename)\\"\\r\\n"', 2);
3341
3341
  push('body += "Content-Type: \\(contentType)\\r\\n\\r\\n"', 2);
@@ -3388,7 +3388,7 @@ var urlsession = {
3388
3388
  push("request.httpBody = postData");
3389
3389
  }
3390
3390
  blank();
3391
- push("let (data, response) = try await URLSession.shared.data(for: request)");
3391
+ push("let (data, _) = try await URLSession.shared.data(for: request)");
3392
3392
  push("print(String(decoding: data, as: UTF8.self))");
3393
3393
  return join();
3394
3394
  }