René's URL Explorer Experiment


Title: Why requests return a separate `status`? · Issue #58 · Smartling/api-sdk-python · GitHub

Open Graph Title: Why requests return a separate `status`? · Issue #58 · Smartling/api-sdk-python

X Title: Why requests return a separate `status`? · Issue #58 · Smartling/api-sdk-python

Description: According to your official docs, requests return a tuple of (response, status). This is counter-intuitive for me because HTTP status is already present as a property of response, even if the response is other than 2xx: In [25]: resp, sta...

Open Graph Description: According to your official docs, requests return a tuple of (response, status). This is counter-intuitive for me because HTTP status is already present as a property of response, even if the respon...

X Description: According to your official docs, requests return a tuple of (response, status). This is counter-intuitive for me because HTTP status is already present as a property of response, even if the respon...

Opengraph URL: https://github.com/Smartling/api-sdk-python/issues/58

X: @github

direct link

Domain: patch-diff.githubusercontent.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Why requests return a separate `status`?","articleBody":"According to your [official docs](https://help.smartling.com/hc/en-us/articles/4412947322267#MakingAPIrequests), requests return a tuple of `(response, status)`. This is counter-intuitive for me because HTTP status is already present as a property of `response`, even if the response is other than `2xx`:\r\n```python\r\nIn [25]: resp, status = jobs_api.getJobDetails('foo')\r\nNon 200 response:404   RequestId:Unknown   URL:https://api.smartling.com/jobs-api/v3/projects/3bea86d16/jobs/foo   response:b'{\"response\":{\"code\":\"NOT_FOUND_ERROR\",\"errors\":[{\"key\":\"not.found\",\"message\":\"Translation job is not found\",\"details\":null}]}}'\r\n\r\nIn [26]: resp.statusCode\r\nOut[26]: 404\r\n\r\nIn [27]: resp.statusCode == status\r\nOut[27]: True\r\n```\r\n\r\nThat makes it slightly less convenient to use because for each request I would need to remember to ignore `status` via `resp, _ = …`.\r\n\r\n**Or is there a reason `status` is separate and I should prefer it over `resp.statusCode`?**","author":{"url":"https://github.com/Toreno96","@type":"Person","name":"Toreno96"},"datePublished":"2023-10-12T13:27:56.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/58/api-sdk-python/issues/58"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:77cc12e2-afd7-ee96-73b2-14003fc35bc8
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idADCA:3E4000:3A19766:4B7A68A:6975062A
html-safe-nonce4d9b337f974488b09d3dece13c95ba610ceda50a0b3dd2806e826f28aed0ecdb
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBRENBOjNFNDAwMDozQTE5NzY2OjRCN0E2OEE6Njk3NTA2MkEiLCJ2aXNpdG9yX2lkIjoiMzM0MzgwMDg5Mjc5MzE3NTQ2IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac28a0877fd59d6b27038a94b39da2dd74e18b6fa56ff091ab007cbd42b4438117
hovercard-subject-tagissue:1940005062
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/Smartling/api-sdk-python/58/issue_layout
twitter:imagehttps://opengraph.githubassets.com/7bbcc091d78f2597255d0b2e22336826442ad6b5bcf2e5b989b339516c38fbb1/Smartling/api-sdk-python/issues/58
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/7bbcc091d78f2597255d0b2e22336826442ad6b5bcf2e5b989b339516c38fbb1/Smartling/api-sdk-python/issues/58
og:image:altAccording to your official docs, requests return a tuple of (response, status). This is counter-intuitive for me because HTTP status is already present as a property of response, even if the respon...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameToreno96
hostnamegithub.com
expected-hostnamegithub.com
None4a4bf5f4e28041a9d2e5c107d7d20b78b4294ba261cab243b28167c16a623a1f
turbo-cache-controlno-preview
go-importgithub.com/Smartling/api-sdk-python git https://github.com/Smartling/api-sdk-python.git
octolytics-dimension-user_id1492945
octolytics-dimension-user_loginSmartling
octolytics-dimension-repository_id3796345
octolytics-dimension-repository_nwoSmartling/api-sdk-python
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id3796345
octolytics-dimension-repository_network_root_nwoSmartling/api-sdk-python
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release488b30e96dfd057fbbe44c6665ccbc030b729dde
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://patch-diff.githubusercontent.com/Smartling/api-sdk-python/issues/58#start-of-content
https://patch-diff.githubusercontent.com/
Sign in https://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2FSmartling%2Fapi-sdk-python%2Fissues%2F58
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2FSmartling%2Fapi-sdk-python%2Fissues%2F58
Sign up https://patch-diff.githubusercontent.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=Smartling%2Fapi-sdk-python
Reloadhttps://patch-diff.githubusercontent.com/Smartling/api-sdk-python/issues/58
Reloadhttps://patch-diff.githubusercontent.com/Smartling/api-sdk-python/issues/58
Reloadhttps://patch-diff.githubusercontent.com/Smartling/api-sdk-python/issues/58
Smartling https://patch-diff.githubusercontent.com/Smartling
api-sdk-pythonhttps://patch-diff.githubusercontent.com/Smartling/api-sdk-python
Notifications https://patch-diff.githubusercontent.com/login?return_to=%2FSmartling%2Fapi-sdk-python
Fork 17 https://patch-diff.githubusercontent.com/login?return_to=%2FSmartling%2Fapi-sdk-python
Star 14 https://patch-diff.githubusercontent.com/login?return_to=%2FSmartling%2Fapi-sdk-python
Code https://patch-diff.githubusercontent.com/Smartling/api-sdk-python
Issues 3 https://patch-diff.githubusercontent.com/Smartling/api-sdk-python/issues
Pull requests 2 https://patch-diff.githubusercontent.com/Smartling/api-sdk-python/pulls
Actions https://patch-diff.githubusercontent.com/Smartling/api-sdk-python/actions
Projects 0 https://patch-diff.githubusercontent.com/Smartling/api-sdk-python/projects
Security 0 https://patch-diff.githubusercontent.com/Smartling/api-sdk-python/security
Insights https://patch-diff.githubusercontent.com/Smartling/api-sdk-python/pulse
Code https://patch-diff.githubusercontent.com/Smartling/api-sdk-python
Issues https://patch-diff.githubusercontent.com/Smartling/api-sdk-python/issues
Pull requests https://patch-diff.githubusercontent.com/Smartling/api-sdk-python/pulls
Actions https://patch-diff.githubusercontent.com/Smartling/api-sdk-python/actions
Projects https://patch-diff.githubusercontent.com/Smartling/api-sdk-python/projects
Security https://patch-diff.githubusercontent.com/Smartling/api-sdk-python/security
Insights https://patch-diff.githubusercontent.com/Smartling/api-sdk-python/pulse
New issuehttps://patch-diff.githubusercontent.com/login?return_to=https://github.com/Smartling/api-sdk-python/issues/58
New issuehttps://patch-diff.githubusercontent.com/login?return_to=https://github.com/Smartling/api-sdk-python/issues/58
Why requests return a separate status?https://patch-diff.githubusercontent.com/Smartling/api-sdk-python/issues/58#top
https://github.com/Toreno96
https://github.com/Toreno96
Toreno96https://github.com/Toreno96
on Oct 12, 2023https://github.com/Smartling/api-sdk-python/issues/58#issue-1940005062
official docshttps://help.smartling.com/hc/en-us/articles/4412947322267#MakingAPIrequests
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.