-2

Details

Currently I have the problem that I cannot accept the certificate on our test page. We use Python requests for our test cases and unittest from Python directly. We have also excluded the acceptance of certificates as described below.

I used Python Request in the latest version and Python in the latest version for the query.

I have actually already excluded the following, i.e. the reminder of the certificates on my test page. See code example. But I get a 405 error after I query the request.

import requests
import logging
from urllib3.exceptions import InsecureRequestWarning
import certifi
import urllib3

# Suppress only the single warning from urllib3 needed.
requests.packages.urllib3.disable_warnings(category=InsecureRequestWarning)

# Set `verify=False` on `requests.post`.
requests.post(url='https://tomypage.html', data={'bar':'baz'}, verify=False)


url = "https://tomypage.html"

Error Message

405 Client Error: Method Not Allowed for url: https://tomypage.html
5
  • 1
    The error means post is not allowed at that endpoint – PDHide Mar 6 '20 at 9:05
  • 1
    It have nothing to do with certificate – PDHide Mar 6 '20 at 9:06
  • 1
    It's an HTML file so only get would be allowed – PDHide Mar 6 '20 at 9:06
  • 1
    405 shows that the specific , HTTP Method is not supported for the specified endpoint – PDHide Mar 6 '20 at 9:08
  • 1
    If unsure, a good starting point for investigating HTTP status codes is this site: developer.mozilla.org/en-US/docs/Web/HTTP/Status It'd most probably lead you to figuring out that there's something wrong with the HTTP method you're using. – pavelsaman Mar 6 '20 at 9:31
1

405 shows that the specific HTTP Method is not supported for the specified endpoint.

It have nothing to do with a certificate.

You are using POST method on a .html file which most probably ain't supported.

Change it to request.get()

4
  • So instead of URL a Request.get () – Mornon Mar 6 '20 at 9:57
  • Do you have a concrete example of this? – Mornon Mar 6 '20 at 9:57
  • @Mornon resttesttest.com just change the method to Post , – PDHide Mar 6 '20 at 10:49
  • you see that you got 405, Now in that website put the endpoint as httpbin.org/post and change the method to get , you will get 405 – PDHide Mar 6 '20 at 10:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.