Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Method is not working due to headers #13

Open
smartfin opened this issue Jan 7, 2019 · 0 comments
Open

Method is not working due to headers #13

smartfin opened this issue Jan 7, 2019 · 0 comments
Labels
help wanted Extra attention is needed

Comments

@smartfin
Copy link
Contributor

smartfin commented Jan 7, 2019

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//<field_name> (accepts/produces text/plain) where <field_name> 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.

@allburov allburov added the help wanted Extra attention is needed label May 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Development

No branches or pull requests

2 participants