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

Af64bc38c0ffcfcabdf430759ee491ce?s=47 Elvis Shi
October 16, 2018

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

Af64bc38c0ffcfcabdf430759ee491ce?s=128

Elvis Shi

October 16, 2018
Tweet

Transcript

  1. ΞϓϦΤϯδχΞʹ஌ͬͯ΄͠ ͍1PTUNBOͷ࢖͍ํ for0UFNBDIJTXJGU

  2. } 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 {
  3. ຊ೔஀ੜ೔

  4. ͓அΓ w ͜ͷൃද͸4XJGUͷίʔυ͕Ұ੾΄ͱΜͲग़·ͤΜ w ͜ͷൃද͸J04ͷ͜ͱҰ੾ग़·ͤΜ

  5. αʔό"1*

  6. αʔό"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^
  7. 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 } }
  8. 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
  9. 仕様書だけでコード組むの怖い! ※どうせ仕様書通りに動かない 確認しながら通信周り
 組んでいきたい!

  10. ƋƒŧūŧƄŧƄ4XJGUƊ
 ǜǏǞlj✣ǟ⊾ƣƑ૫֚ŧl

  11. 1PTUNBO

  12. IUUQTXXXHFUQPTUNBODPNBQQT

  13. None
  14. 1PTUNBO(MPTTBSZ w 8PSLTQBDF w ෳ਺ͷϓϩδΣΫτΛ·ͱΊͨ৔ॴ w $PMMFDUJPOT w ҰͭͷϓϩδΣΫτͰ࢖͏༷ʑͳ؀ڥ΍"1*Λ·ͱ Ίͨ৔ॴ

    w &OWJSPONFOU w ֤छ؀ڥʢ%FW؀ڥͩͱ͔ຊ൪؀ڥͩͱ͔ʣ w 3FRVFTU w ࣮ࡍͷ"1*ϦΫΤετ
  15. 1PTUNBOͷϝϦοτ w ม਺ΛهԱͰ͖Δʗ؀ڥʹԠͯ͡࢖͍෼͚͕Ͱ͖Δ w +BWB4DSJQUͰϦΫΤετͷલ΍ޙʹಈ࡞ΛૠೖͰ͖Δ

  16. w 4UBHJOH؀ڥͷςετΞΧ΢ϯτ৘ใΛऔಘ w ΞΧ΢ϯτ৘ใͰϩάΠϯ"1*Λୟ͘ w ϩάΠϯࡁΈͷ5PLFOΛར༻ͯ͠ผͷ"1*Λୟ͘

  17. 1PTUNBOʹ4UBHJOH؀ڥͰඞཁͳม਺Λ
 ؀ڥઃఆͰఆٛ

  18. 3FRVFTUΛ࡞੒͠ɺύε΍ϘσΟͳͲΛ
 طఆͷม਺͔Βఆٛ ʢ{{variableName}}Ͱม਺Λ࢖͑Δʣ

  19. ʮ4FOEʯΛԡͤ͹ฦ͖ͬͯͨϨεϙϯεΛ
 ͙͢ʹ֬ೝͰ͖Δ

  20. ʮ5FTUTʯͰϨεϙϯε΋ΒͬͨޙͷॲཧΛ
 +BWB4DSJQUͰॻ͚Δ
 ʢຊདྷ͸ϨεϙϯεΛςετ͢ΔͨΊͰ͕͢
 ςετҎ֎Ͱ΋࢖͑Δʣ

  21. w pmͰ1PTUNBOͷϝιουΛݺͼग़ͤΔ w pm.response.json();ͰϨεϙϯεͷ +40/ΦϒδΣΫτΛऔಘͰ͖Δ w pm.environment.set(key, value);Ͱ ؀ڥʹม਺ΛઃఆͰ͖Δ w

    IUUQTXXXHFUQPTUNBODPNEPDTW QPTUNBOTDSJQUTUFTU@TDSJQUT
  22. ʮ5FTUTʯͰอଘͨ͠token͕௥Ճ͞Εͨ

  23. อଘ͞ΕͨtokenΛ࢖ͬͯผͷ"1*Λୟ͚ͨ

  24. r੕໺ܙྤ l1PTUNBOͰखܰͳ"1*֬ೝΛz

  25. ʲએ఻ʳ

  26. J04ΞϓϦઃܭύλʔϯೖ໳ IUUQTQFBLTDDJ04@BSDIJUFDUVSF

  27. גࣜձࣾΏΊΈɺΤϯδχΞઈࢍืूத IUUQSFDSVJUZVNFNJDPKQ