Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

405 Client Error: METHOD NOT ALLOWED for url: https://www3.cmbi.umcn.nl/xssp/api/create/pdb_file/dssp #101

Open
miotomtao opened this issue Aug 27, 2019 · 13 comments

Comments

@miotomtao
Copy link

I try to extract dssp using API example provided, either by pdb_id or pdb_files, but neither works. I got 405 Client Error: METHOD NOT ALLOWED for url: https://www3.cmbi.umcn.nl/xssp/api/create/pdb_file/dssp. Anyone could help with that? Thank you.

@cbaakman
Copy link
Contributor

You're probably sending an http GET request. The 'create' entry point expects a POST request.

@miotomtao
Copy link
Author

I use the following API example code:

files = {'file_': open(pdb_file_path, 'rb')}
url_create = '{}api/create/pdb_file/dssp'.format(rest_url)
r = requests.post(url_create, files=files)
r.raise_for_status()
ob_id = json.loads(r.text)['id']
print("Job submitted successfully. Id is: '{}'".format(job_id))

I use post request for 'create' entry.

@cbaakman
Copy link
Contributor

You need to add a slash to the end of your 'url_create':

https://www3.cmbi.umcn.nl/xssp/api/create/pdb_file/dssp/

@miotomtao
Copy link
Author

I add a slash there but got the same error.

@cbaakman
Copy link
Contributor

What is the value of 'rest_url' in your code?

@koyurion
Copy link

koyurion commented Jan 9, 2020

I meet the same error, rest_url = "http://www.cmbi.umcn.nl/xssp/"

@koyurion
Copy link

koyurion commented Jan 9, 2020

Please try:

  1. Use " https" instead of "http"
    rest_url = "https://www.cmbi.umcn.nl/xssp/"
  2. Add " verify=False"
    r = requests.post(url_create, files=files,verify=False)

@cbaakman
Copy link
Contributor

cbaakman commented Jan 9, 2020

To me it also works with verify=True. But yes, the https protocol is mandatory. Though, you're supposed to be redirected.

A 4xx error indicates a problem with the request. Is there any error message provided with the error?
Could you provide the full HTTP response?

@lzx-dot
Copy link

lzx-dot commented Apr 18, 2022

I try to extract dssp using API example provided, either by pdb_id or pdb_files, but neither works. I got 405 Client Error: METHOD NOT ALLOWED for url: https://www3.cmbi.umcn.nl/xssp/api/create/pdb_file/dssp. Anyone could help with that? Thank you.

I meet the same error, did you solve it?

@koyurion
Copy link

koyurion commented Apr 18, 2022 via email

@cbaakman
Copy link
Contributor

How about my suggestion of using a POST request?

@1000000000000000000000000000000

I am also getting this same error.

@koyurion
Copy link

koyurion commented Oct 11, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants