Впервые я использую Python остальные вызовы API.
Ответ был успешным, единственное, что я хотел бы видеть только объект json вместо разметки html. Сейчас я использую этот подход:
import json
import requests
from requests.auth import HTTPDigestAuth
url = "http://api.url"
myResponse = requests.get(url, auth=HTTPDigestAuth(
'username', 'password'), verify=True)
if(myResponse.ok):
print(myResponse.content)
else:
myResponse.raise_for_status()
Возвращается такая вещь:
b'\n<!DOCTYPE html>\n<html lang="en">\n<head>\n \n\n\n\n\n\n\n\n\n<meta charset="utf-8">\n<meta http-equiv="X-UA-Compatible" content="IE=Edge"/>\n<meta name="application-name" content="JIRA" data-name="jira" data-version="8.1.0"><meta name="ajs-server-scheme" content="https">\n<meta name="ajs-server-port" content="443">\n<meta name="ajs-server-name" content="jira.trust-itservices.com">\n<meta name="ajs-behind-proxy" content="null">\n<meta name="ajs-base-url" content="https://jira.trust-itservices.com">\n<meta name="ajs-dev-mode" content="false">\n<meta name="ajs-context-path" content="">\n<meta name="ajs-version-number" content="8.1.0">\n<meta name="ajs-build-number" content="801000">\n<meta name="ajs-is-beta" content="false">\n<meta name="ajs-is-rc" content="false">\n<meta name="ajs-is-snapshot" content="false">\n<meta name="ajs-is-milestone" content="false">\n<meta name="ajs-remote-user" content="">\n<meta name="ajs-remote-user-fullname" content="">\n<meta name="ajs-user-locale" content="en">\n<meta name="ajs-user-locale-group-separator" content=",">\n<meta name="ajs-app-title" content="Trust-IT Jira">\n<meta name="ajs-keyboard-shortcuts-enabled" content="true">\n<meta name="ajs-keyboard-accesskey-modifier" content="Alt">\n<meta name="ajs-enabled-dark-features" content="["com.atlassian.jira.agile.darkfeature.editable.detailsview","nps.survey.inline.dialog","com.atlassian.jira.agile.darkfeature.edit.closed.sprint.enabled","jira.plugin.devstatus.phasetwo","jira.frother.reporter.field","atlassian.rest.xsrf.legacy.enabled","jira.issue.status.lozenge","com.atlassian.jira.config.BIG_PIPE","com.atlassian.jira.projects.issuenavigator","com.atlassian.jira.config.PDL","jira.plugin.devstatus.phasetwo.enabled","atlassian.aui.raphael.disabled","app-switcher.new","frother.assignee.field","com.atlassian.jira.projects.ProjectCentricNavigation.Switch","jira.onboarding.cyoa","com.atlassian.jira.agile.darkfeature.kanplan.enabled","com.atlassian.jira.config.ProjectConfig.MENU","com.atlassian.jira.projects.sidebar.DEFER_RESOURCES","com.atlassian.jira.agile.darkfeature.kanplan.epics.and.versions.enabled","com.atlassian.jira.agile.darkfeature.sprint.goal.enabled","jira.zdu.admin-updates-ui","jira.zdu.jmx-monitoring","sd.new.settings.sidebar.location.disabled","jira.zdu.cluster-upgrade-state","com.atlassian.jira.agile.darkfeature.splitissue","com.atlassian.jira.config.CoreFeatures.LICENSE_ROLES_ENABLED","jira.export.csv.enabled"]">\n<meta name="ajs-in-admin-mode" content="false">\n<meta name="ajs-is-sysadmin" content="false">\n<meta name="ajs-is-admin" content="false">\n<meta name="ajs-outgoing-mail-enabled" content="true">\n<meta name="ajs-archiving-enabled" content="false">\n<meta name="ajs-date-relativize" content="true">\n<meta name="ajs-date-time" content="h:mm a">\n<meta name="ajs-date-day" content="EEEE h:mm a">\n<meta name="ajs-date-dmy" content="dd/MMM/yy">\n<meta name="ajs-date-complete" content="dd/MMM/yy h:mm a">\n<script type="text/javascript">var AJS=AJS||{};AJS.debug=true;</script>\n\n\n \n<meta id="atlassian-token" name="atlassian-token" content="BWAC-8WBU-XNHK-O6U3_9eb738dc34edaad0f9eea8dae9a3812ff08af029_lout">\n\n\n\n<link rel="shortcut icon" href="/s/-4jfu5e/801000/6411e0087192541a09d88223fb51a6a0/_/images/fav-jsw.png">\n\n\n \n\n\n\n
Это выглядит как смесь между html и json, но я хотите увидеть только json, который можно увидеть, открыв браузер!
Пропустил ли я каким-либо способом?
Заранее спасибо.