WGLab / PhenCards

Development of phencards.org web server for one stop shop of phenotype information
5 stars 1 forks source link

Adding Doc2HPO to site, and fixing redirects for API #38

Closed jimhavrilla closed 4 years ago

jimhavrilla commented 4 years ago

If running this test script on reslnklab01:

import requests
import json
# for string-based match. faster.
url = "http://localhost:8000/doc2hpo/parse/acdat"
json = {
        "note": "He denies synophrys.",
    "negex": True
}
# headers = {'Content-type': 'application/json', 'Accept': 'text/plain'}
r = requests.post(url,json = json)
print(r.json())

You obtain the output:

{'hmName2Id': [{'start': 10, 'length': 9, 'hpoId': 'HP:0000664', 'hpoName': 'synophrys', 'negated': True}], 'hpoOption': False}

Because of the http.

If you run the same script with https:

import requests
import json
# for string-based match. faster.
url = "https://localhost:8000/doc2hpo/parse/acdat"
json = {
        "note": "He denies synophrys.",
    "negex": True
}
# headers = {'Content-type': 'application/json', 'Accept': 'text/plain'}
r = requests.post(url,json = json)
print(r.json())

You get the error:

requests.exceptions.SSLError: HTTPSConnectionPool(host='localhost', port=8000): Max retries exceeded with url: /doc2hpo/parse/acdat (Caused by SSLError(SSLError("bad handshake: Error([('SSL routines', 'ssl3_get_record', 'wrong version number')])")))
jimhavrilla commented 4 years ago

done with commit 7e13523f0b310f7d42dd632c91a144a2e069afc3