Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- '''
- [1]
- http://www.cbr.ru/development/memorable_coins/
- [2]
- http://www.cbr.ru/CoinsBaseWS/CoinsBaseWS.asmx?op=GetMonetDetailInfo
- '''
- #это - мой код:
- import requests
- endpoint = "https://www.cbr.ru/CoinsBaseWS/CoinsBaseWS.asmx"
- body = """
- <?xml version="1.0" encoding="utf-8"?>
- <soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
- <soap12:Body>
- <GetMonetDetailInfo xmlns="http://web.cbr.ru/">
- <CatNumber>5111-0451</CatNumber>
- <Eng>false</Eng>
- </GetMonetDetailInfo>
- </soap12:Body>
- </soap12:Envelope>
- """
- body = body.encode('utf-8')
- headers = {"Content-Type": "application/soap+xml; charset=utf-8",
- "Content-Length": str(len(body)),
- "host": 'www.cbr.ru',
- 'SOAPAction': "http://web.cbr.ru/GetMonetDetailInfo"
- }
- response = requests.get(url=endpoint, data = body, headers = headers)
- # session = requests.session()
- # session.headers = {"Content-Type": "application/soap+xml; charset=utf-8"}
- # session.headers.update({"Content-Length": str(len(body))})
- # # session.headers.update({"host": 'www.cbr.ru'})
- # response = session.post(url=endpoint, data=body, verify=False)
- print(response.status_code)
- print(response.text)
- '''
- response.staus_code возвращает 200, ок, работает.
- но само тело - вообще не о том ((
- '''
Add Comment
Please, Sign In to add comment