Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Python Requests
#1
Hi,
I have started looking at requests in Python.
It must be possible to add both an ssl and authentication right?
If correct, how.

Also, you can write payloads to class's right.

Thanks, Smile
Reply
#2
(Sep-07-2020, 10:46 AM)Aussie Wrote: It must be possible to add both an ssl and authentication right?

If the server supports HTTPS, then you just use "https" as the scheme in the URL. Did you check the docs, particularly the Advanced usage section?

Quote:Also, you can write payloads to class's right.

I don't understand what this means.
Reply
#3
Hi,
I have managed to get Auth working. However, using the SSL certificate is proving difficult.
Any ideas?
--------------------------------------------------------------------------
import requests

x = requests.get('https://xxxxx.xxxxxxx.xxxxxxxx.internal:8443/rest/xxxx/retrieveRequestDetails?RequestNo=000002572354', headers={"Authorization": "Basic %s" % base64_bytes}, verify ='C:/Users/Administrator/Desktop/xxxxxxx.cer')

print(x.text)

Thanks,
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Python requests oauth2 access token herobpv 6 1,474 Sep-27-2021, 06:54 PM
Last Post: herobpv
  Python Requests SSL Aussie 0 1,097 Jan-07-2021, 02:09 AM
Last Post: Aussie
  Python Requests package: Handling xml response soumyarani 1 1,202 Sep-14-2020, 11:41 AM
Last Post: buran
  Python API and requests deep_logic 9 2,254 Jul-29-2020, 03:47 PM
Last Post: ndc85430
  How to save Python Requests data sent to server? RedLeonard 5 2,574 Jul-05-2020, 10:33 AM
Last Post: RedLeonard
  How to do the same as python -m requests.certs inside script? geekgeek 2 1,401 Feb-27-2020, 07:11 AM
Last Post: buran
  Python requests writes the name of the file instead of contents to web page bluethundr 1 1,501 Jun-05-2019, 09:35 PM
Last Post: Larz60+
  Python requests module doesn not return status_code palo173 5 2,211 May-21-2019, 09:22 AM
Last Post: buran
  Curl command to python requests pythonclass 0 2,603 Apr-12-2019, 06:29 PM
Last Post: pythonclass
  C++ programmer requests Python Web/database advice GregReese 3 1,414 Apr-10-2019, 09:41 PM
Last Post: snippsat

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020