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 library .JSON() error mHosseinDS86 6 3,400 Dec-19-2022, 08:28 PM
Last Post: deanhystad
  Python requests oauth2 access token herobpv 6 3,891 Sep-27-2021, 06:54 PM
Last Post: herobpv
  Python Requests SSL Aussie 0 1,990 Jan-07-2021, 02:09 AM
Last Post: Aussie
  Python Requests package: Handling xml response soumyarani 1 2,150 Sep-14-2020, 11:41 AM
Last Post: buran
  Python API and requests deep_logic 9 4,295 Jul-29-2020, 03:47 PM
Last Post: ndc85430
  How to save Python Requests data sent to server? RedLeonard 5 4,936 Jul-05-2020, 10:33 AM
Last Post: RedLeonard
  How to do the same as python -m requests.certs inside script? geekgeek 2 2,263 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 2,152 Jun-05-2019, 09:35 PM
Last Post: Larz60+
  Python requests module doesn not return status_code palo173 5 3,414 May-21-2019, 09:22 AM
Last Post: buran
  Curl command to python requests pythonclass 0 3,409 Apr-12-2019, 06:29 PM
Last Post: pythonclass

Forum Jump:

User Panel Messages

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