Axios: ๊ฒŒ์‹œ๋ฌผ ์š”์ฒญ ์‹œ ์ฟ ํ‚ค๊ฐ€ ์ž๋™์œผ๋กœ ์ „์†ก๋˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค!

์— ๋งŒ๋“  2017๋…„ 09์›” 07์ผ  ยท  3์ฝ”๋ฉ˜ํŠธ  ยท  ์ถœ์ฒ˜: axios/axios

์š”์•ฝ:
์ด์ „ _get_ ํ˜ธ์ถœ์—์„œ ๋ฐ›์€ ์ฟ ํ‚ค๋Š” ๋‹ค์Œ _post_ ๋ช…๋ น์œผ๋กœ ๋ณด๋‚ด์ง€ ์•Š์Šต๋‹ˆ๋‹ค.

์„ธ๋ถ€:
๋ฐฑ์—”๋“œ์— ๋กœ๊ทธ์ธํ•˜๊ธฐ ์œ„ํ•ด ๋‹ค์Œ๊ณผ ๊ฐ™์€ ์ผ๋ จ์˜ ํ˜ธ์ถœ์„ ์‚ฌ์šฉํ•˜๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค.

axios.get(Url.csrfToken(), { withCredentials: true })
            .then(response => response.data)
            .then(token => axios.post(Url.authenticate(), { username, password }, {
                    headers: {
                        'content-type' : 'application/x-www-form-urlencoded',
                        'crsf-token' : `${token.csrfToken}`
                    },
                    withCredentials: true
                })
            )
            .then(response => console.log('completed'))
            .catch(error => console.log(error))

_get()_์— ๋Œ€ํ•œ ์‘๋‹ต ํ—ค๋”์˜ set-cookie ์— ๋ฐ˜ํ™˜๋œ ์ฟ ํ‚ค๋Š” _post()_์— ํ•„์š”ํ•ฉ๋‹ˆ๋‹ค.

๊ทธ๋Ÿฌ๋‚˜ post()๋Š” ํ—ค๋”์— ์ฟ ํ‚ค๊ฐ€ ์—†์œผ๋ฏ€๋กœ ์‹คํŒจํ•ฉ๋‹ˆ๋‹ค.

์–ด๋–ป๊ฒŒ ๊ณ ์น  ์ˆ˜ ์žˆ์Šต๋‹ˆ๊นŒ? ๋„์™€์ฃผ์„ธ์š”.

ํ™˜๊ฒฝ

  • ๋ฐ˜์‘: 16.0.0-alpha.12
  • ๋ฐ˜์‘ ๋„ค์ดํ‹ฐ๋ธŒ: 0.47.2
  • iOS ์‹œ๋ฎฌ๋ ˆ์ดํ„ฐ - ๋ฒ„์ „ 10.0

๊ฐ€์žฅ ์œ ์šฉํ•œ ๋Œ“๊ธ€

๋„์›€์ด ๋˜๋‚˜์š”?

https://stackoverflow.com/questions/46288437/set-cookie-header-has-no-effect

2017๋…„ 9์›” 25์ผ ์›”์š”์ผ 22:28์— Chris Gillis [email protected] ์ด ๋‹ค์Œ๊ณผ ๊ฐ™์ด ์ผ์Šต๋‹ˆ๋‹ค.

๋˜ํ•œ ํ˜ธ๊ธฐ์‹ฌ

โ€”
์ด ์Šค๋ ˆ๋“œ์— ๊ฐ€์ž…ํ–ˆ๊ธฐ ๋•Œ๋ฌธ์— ์ด ๋ฉ”์‹œ์ง€๋ฅผ ๋ฐ›๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค.
์ด ์ด๋ฉ”์ผ์— ์ง์ ‘ ๋‹ต์žฅํ•˜๊ณ  GitHub์—์„œ ํ™•์ธํ•˜์„ธ์š”.
https://github.com/mzabriskie/axios/issues/1076#issuecomment-332002134 ,
๋˜๋Š” ์Šค๋ ˆ๋“œ ์Œ์†Œ๊ฑฐ
https://github.com/notifications/unsubscribe-auth/AVepSmu6HPCE7R-bdBHXU4wa12co56ekks5smAzWgaJpZM4PPYy9
.

๋ชจ๋“  3 ๋Œ“๊ธ€

@varmeh ์ด๊ฒƒ์„ ์–ด๋–ป๊ฒŒ ๊ณ ์ณค์Šต๋‹ˆ๊นŒ?

๋˜ํ•œ ํ˜ธ๊ธฐ์‹ฌ

๋„์›€์ด ๋˜๋‚˜์š”?

https://stackoverflow.com/questions/46288437/set-cookie-header-has-no-effect

2017๋…„ 9์›” 25์ผ ์›”์š”์ผ 22:28์— Chris Gillis [email protected] ์ด ๋‹ค์Œ๊ณผ ๊ฐ™์ด ์ผ์Šต๋‹ˆ๋‹ค.

๋˜ํ•œ ํ˜ธ๊ธฐ์‹ฌ

โ€”
์ด ์Šค๋ ˆ๋“œ์— ๊ฐ€์ž…ํ–ˆ๊ธฐ ๋•Œ๋ฌธ์— ์ด ๋ฉ”์‹œ์ง€๋ฅผ ๋ฐ›๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค.
์ด ์ด๋ฉ”์ผ์— ์ง์ ‘ ๋‹ต์žฅํ•˜๊ณ  GitHub์—์„œ ํ™•์ธํ•˜์„ธ์š”.
https://github.com/mzabriskie/axios/issues/1076#issuecomment-332002134 ,
๋˜๋Š” ์Šค๋ ˆ๋“œ ์Œ์†Œ๊ฑฐ
https://github.com/notifications/unsubscribe-auth/AVepSmu6HPCE7R-bdBHXU4wa12co56ekks5smAzWgaJpZM4PPYy9
.

์ด ํŽ˜์ด์ง€๊ฐ€ ๋„์›€์ด ๋˜์—ˆ๋‚˜์š”?
0 / 5 - 0 ๋“ฑ๊ธ‰