Skip to content
Discussion options

You must be logged in to vote

Yeah, that's similar to what I did, but I have a function.

from httpx import Client

from syncer import config


class HTTPClient:
    def __init__(self):
        self._client = None
        self._default_headers = {"Content-Type": "application/json"}
        self._default_params = {"api-version": "7.0"}

    def client(self):
        if self._client is None:
            self._client = Client(
                auth=("", config.get("pat")),
                headers=self._default_headers,
                params=self._default_params,
            )
        return self._client

def url(org_id, project_id, endpoint):
    return f"https://dev.azure.com/{org_id}/{project_id}/_apis/wit/workitems/{en…

Replies: 3 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@BeyondEvil
Comment options

Answer selected by lovelydinosaur
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants