아래 Python에서 MS Teams 웹훅에 메시지를 게시하려고합니다.
pmr = urllib3.PoolManager()
text='hello world'
message = {"Test":text}
enco_message = json.dumps(message).encode('utf-8')
r=pmr.request('POST',url, headers={'Content-Type': 'application/json'}, body=enco_message)
print(r.status)
그러나 이것은 팀에 메시지를 보내지 않고 응답 상태를 반환합니다 400
. 코드에서 무엇을 변경할지 확실하지 않습니다. 도와 주셔서 감사합니다.
이것은 아래와 같이 text
에서 키워드를 명시 적으로 지정하여 작동 json
합니다.
pmr = urllib3.PoolManager()
msg='hello world'
message = {"text":msg}
enco_message = json.dumps(message).encode('utf-8')
r=pmr.request('POST',url, headers={'Content-Type': 'application/json'},
body=enco_message)
페이로드는 키워드에서만 작동합니다 text
.
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다