Method is not working due to headers
- Dominant language
- Python
- Stars
- 36
- Forks
- 11
- PR merge metrics
- No merged PRs in 30d
Description
As we can find in TeamCity documentation there is specific method to get/update some project paramteres:
> Project name/description/archived status: GET/PUT http://teamcity:8111/app/rest/projects// (accepts/produces text/plain) where is one of "name", "description", "archived".
It accepts only `text/plain` headers that's why it's not really easy to use this method with current version of client.
```
def set_description(tc, locator, description):
old_default_headers = tc.default_headers.copy()
tc.set_default_header(header_name='Content-type', header_value='text/plain')
tc.set_default_header(header_name='Accept', header_value='text/plain')
result = tc.projects.set_project_filed(project_locator=locator, field='description',
body=description)
tc.default_headers = old_default_headers.copy()
del (old_default_headers)
```
Probably, this method should be updated and this kind of issues with specific headers also handled by client.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start at the projects.set_project_filed method and inspect how the client builds request headers for the TeamCity project field endpoint. Confirm how text/plain Accept and Content-type headers should be handled, then verify that updating a project field works without requiring callers to replace the client's default headers.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100