We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
rtcclient 0.7.0 RTC 6.0.6.1
When adding an attachment, the file is successfully uploaded, but when linking to the workitem the server complains about malformed XML.
To get it to work I fixed _add_attachment_link to use JSON:
_add_attachment_link
def _add_attachment_link(self, attachment_info): headers = copy.deepcopy(self.rtc_obj.headers) headers["Content-Type"] = self.OSLC_CR_JSON payload = {"rdf:resource": attachment_info["url"], "dcterms:title": ": ".join([str(attachment_info["id"]), attachment_info["name"]])} attachment_tag = ("/rtc_cm:com.ibm.team.workitem.linktype." "attachment.attachment") attachment_collection_url = self.url + attachment_tag resp = self.post(attachment_collection_url, json.dumps(payload), verify=False, headers=headers, proxies=self.rtc_obj.proxies) raw_data = xmltodict.parse(resp.content) return Attachment(attachment_info["url"], self.rtc_obj, raw_data=raw_data["rtc_cm:Attachment"])
The text was updated successfully, but these errors were encountered:
@s7eph4n Please try to validate your xml file first. Try this online validator.
Sorry, something went wrong.
That's the thing. There is no XML sent by the original code as far as I can tell, instead payload is posted as is. https://github.com/dixudx/rtcclient/blob/6c91ff29/rtcclient/workitem.py#L809
payload
No branches or pull requests
rtcclient 0.7.0
RTC 6.0.6.1
When adding an attachment, the file is successfully uploaded, but when linking to the workitem the server complains about malformed XML.
To get it to work I fixed
_add_attachment_link
to use JSON:The text was updated successfully, but these errors were encountered: