Programing

컬 설정 Content-Type이 잘못되었습니다.

lottogame 2020. 9. 23. 08:03
반응형

컬 설정 Content-Type이 잘못되었습니다.


명령 줄에서 컬 작업을 실행 중이며 헤더를 XML로 설정하는 데 문제가 있습니다. -H 옵션을 사용하여 Content-Type을 xml로 강제 설정했지만 명령을 실행하면 헤더가 내가 보내는 데이터 값 중 하나를 오염시키는 urlencoded로 전송되는 것을 볼 수 있습니다. 누군가가 Content-Type이 항상 "application / atom + xml"대신 "application / x-www-form-urlencoded"로 재설정되는 이유를 설명 할 수 있습니까?

이 API를 사용하여 YouTube에서 업로드 토큰을 검색하는 데 사용하고 있습니다. 유사한 명령을 사용하여 인증 토큰을 검색하는 데 문제가 없습니다.

curl -S -v 
--location http://gdata.youtube.com/action/GetUploadToken
-H Content-Type= text/xml
--data content=some xml content here
--data GoogleLogin auth="DQAAAHU.....TiU95NXYSLFFENTbNQUy....NjfFoC0nyEKaz-ejEkA_w"
-H X-Gdata-Key: key=AI39si5EQyo-_L......78eL80r-MooHXtrA48R82AShoQ
-H Content-Length=445

지정하고 싶은 것 같아요

-H "Content-Type:text/xml"

같지 않은 콜론으로.

참고 URL : https://stackoverflow.com/questions/1745318/curl-setting-content-type-incorrectly

반응형