[Delete] NEMeetingKit_Special 4.9.6
[CocoaPods.git] / Specs / 3 / 4 / 7 / XChanger / 1.0.1 / XChanger.podspec.json
blobd94950db340b87b82f299b5a81705c7e538e6ad1
2   "name": "XChanger",
3   "version": "1.0.1",
4   "summary": "XChanger can exchange to behavior for URL request and response",
5   "description": "XChanger can exchange to behavior for URL request and response\n\n## Usage\nFirst, XChanger should call to start with `XChanger.register()`.\n```swift\nXChanger.register()\n```\n\nSecond, define URL request and response.   \nFor example, It will return body of the response is `{\"id\": 10, name:\"bannzai\"}` and the response status code is 200, when you make a request to `https://exmaple.com/v1/users/10`.\n\nDefine exchange.\n```swift\nlet url = \"https://exmaple.com/v1/users/10\"\nlet json = try! JSONEncoder().encode(User(id: 10, name: \"bannzai\"))\nXChanger.exchange().request(url: url).response(data: json, statusCode: 200).enable()\n```\n\nRequest actually with URLSession.\n```swift\nlet request = URLRequest(url: URL(string: \"https://exmaple.com/v1/users/10\")!)\nlet session = URLSession(configuration: URLSessionConfiguration.default)\nsession.dataTask(with: request) { data, response, error in\n  guard let httpResponse = response as? HTTPURLResponse else {\n      return fatalError(\"Unexpected response type of HTTPURLResponse\")\n  }\n  print(httpResponse.statusCode) // 200\n  \n  let decoded = try! JSONDecoder().decode(User.self, from: data!)\n  print(decoded) // User(id: 10, name: \"bannzai\")\n}.resume()\n```",
6   "homepage": "https://github.com/bannzai/XChanger",
7   "license": "MIT",
8   "authors": {
9     "bannzai": "kingkong999yhirose@gmail.com"
10   },
11   "source": {
12     "git": "https://github.com/bannzai/XChanger.git",
13     "tag": "1.0.1"
14   },
15   "source_files": "Sources/XChanger/*.swift",
16   "platforms": {
17     "ios": "11.0"
18   },
19   "swift_versions": "5.2",
20   "swift_version": "5.2"