Skip to content

Commit 40c68dc

Browse files
authored
feat: move swift from NSURLSession to URLSession (#226)
## 🧰 Changes - Support Concurrency(Async/Await) - Replace to modern class from classic(NS) class - Support Code on Linux/Windows Describe in detail what this PR is for. ## 🧬 QA & Testing I fixed code in `/httpsnippet/src/targets/swift/urlsession/fixtures/` `npm run test`
1 parent 94f9897 commit 40c68dc

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+333
-529
lines changed

src/helpers/__snapshots__/utils.test.ts.snap

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -392,14 +392,14 @@ exports[`availableTargets > returns all available targets 1`] = `
392392
{
393393
"clients": [
394394
{
395-
"description": "Foundation's NSURLSession request",
395+
"description": "Foundation's URLSession request",
396396
"extname": ".swift",
397-
"key": "nsurlsession",
398-
"link": "https://developer.apple.com/library/mac/documentation/Foundation/Reference/NSURLSession_class/index.html",
399-
"title": "NSURLSession",
397+
"key": "urlsession",
398+
"link": "https://developer.apple.com/documentation/foundation/urlsession",
399+
"title": "URLSession",
400400
},
401401
],
402-
"default": "nsurlsession",
402+
"default": "urlsession",
403403
"key": "swift",
404404
"title": "Swift",
405405
},

src/targets/swift/helpers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ export const literalRepresentation = <T, U>(value: T, opts: U, indentLevel?: num
7979

8080
default:
8181
if (value === null || value === undefined) {
82-
return '';
82+
return 'nil';
8383
}
8484
return `"${(value as any).toString().replace(/"/g, '\\"')}"`;
8585
}

src/targets/swift/nsurlsession/fixtures/application-form-encoded.swift

Lines changed: 0 additions & 25 deletions
This file was deleted.

src/targets/swift/nsurlsession/fixtures/application-json.swift

Lines changed: 0 additions & 32 deletions
This file was deleted.

src/targets/swift/nsurlsession/fixtures/cookies.swift

Lines changed: 0 additions & 21 deletions
This file was deleted.

src/targets/swift/nsurlsession/fixtures/custom-method.swift

Lines changed: 0 additions & 18 deletions
This file was deleted.

src/targets/swift/nsurlsession/fixtures/full.swift

Lines changed: 0 additions & 28 deletions
This file was deleted.

src/targets/swift/nsurlsession/fixtures/headers.swift

Lines changed: 0 additions & 26 deletions
This file was deleted.

src/targets/swift/nsurlsession/fixtures/http-insecure.swift

Lines changed: 0 additions & 18 deletions
This file was deleted.

src/targets/swift/nsurlsession/fixtures/indent-option.swift

Lines changed: 0 additions & 18 deletions
This file was deleted.

0 commit comments

Comments
 (0)