请编写一段代码,用于访问 服务器登录接口/redfish/1/CreateSession,达到创建 session 的目的,接口协议为https,ip为127.0.0.1,方法为post,需要提交的请求体信息为json格式,(UserName“admin”;Password”:”Password@_”),不限编程语言
import requests url="https://127.0.0.1/redfish/1/CreateSession" header_info = {"Content-Type":"application/json"} canshu = { "username" : "admin", "password": "123" } response = requests.post(url,headers=header_info,json=canshu) print(f"请求体为json格式,返回的响应体为:{response.json()}")