Upgrade to Pro — share decks privately, control downloads, hide ads and more …

アプリエンジニアに知ってほしい Postman の使い方

Elvis Shi
October 16, 2018

アプリエンジニアに知ってほしい Postman の使い方

Elvis Shi

October 16, 2018
Tweet

More Decks by Elvis Shi

Other Decks in Programming

Transcript

  1. } var employedBy = "YUMEMI Inc." var job = "iOS

    Developer" var favoriteLanguage = "Swift" var twitter = "@lovee" var qiita = "lovee" var github = "el-hoshino" var additionalInfo = """ ৭ʑਐḿ͕΍͹͍ """ class Me: Developable, Talkable {
  2. αʔό"1* w ϕʔε63- w IUUQTXXXTFSWFSDPN w ύε w MPHJO w

    ϝιου w 1045 w ϘσΟʢ+40/ͳͲʣ w \NBJMTPNFCPEZ!TPNFXIFSFDPN QBTTXPSE6T'HP^ w Ϩεϙϯεʢ+40/ͳͲʣ w \TVDDFTTUSVF UPLFO&&/LX9Y%7B9;ST1/ZETZH&&H^
  3. extension LoginRequest: Request { var baseURL: URL { return self.apiURL

    } var method: HTTPMethod { return .post } var path: String { return "/login" } var parameters: Any? { let postingParameters: [String: Any?] = [ "mail": self.mail, "password": self.password ] return postingParameters } struct Response: Decodable { let token: String } }
  4. extension LoginRequest: Request { var baseURL: URL { return self.apiURL

    } var method: HTTPMethod { return .post } var path: String { return "/login" } var parameters: Any? { let postingParameters: [String: Any?] = [ "mail": self.mail, "password": self.password ] return postingParameters } struct Response: Decodable { let token: String } } let request = LoginRequest(apiURL: userAPIBaseURL, mail: mail, password: password) Session.send(request) { [unowned self] (result) in switch result { case .success(let response): let status = self.makeAccountStatus(from: response) completion?(status) case .failure(let error): let status = self.makeAccountStatus(from: error) completion?(status) } } $PEFXJUI"1*,JU
 IUUQTHJUIVCDPNJTILBXB"1*,JU
  5. 1PTUNBO(MPTTBSZ w 8PSLTQBDF w ෳ਺ͷϓϩδΣΫτΛ·ͱΊͨ৔ॴ w $PMMFDUJPOT w ҰͭͷϓϩδΣΫτͰ࢖͏༷ʑͳ؀ڥ΍"1*Λ·ͱ Ίͨ৔ॴ

    w &OWJSPONFOU w ֤छ؀ڥʢ%FW؀ڥͩͱ͔ຊ൪؀ڥͩͱ͔ʣ w 3FRVFTU w ࣮ࡍͷ"1*ϦΫΤετ