0

I am able to authenticate and do read operations, but I can't get uploading attachments to work. Always ends up with 500 - Internal server error. I won't bother to include any code here. I have tried many approaches, all with the same result.

In the end I want to upload e-mail (.msg files), but I have also tried with plain .txt files. No diff. I have been trying to upload to ALM defects.

Does anyone have a code snipped or can direct me to one? Prefer C# if possible.

Lars Moe
  • 67
  • 11
  • I'm again.. https://github.com/macroking/ALM-Integration/blob/master/ALM_Integration_Util.py Refere the upload_result_file method. – Barney Apr 29 '17 at 16:28
  • Thanks @Barney: You are referring to this method? Unfortunately I am not that familiar with Python, but I'll try to convert. Quite different from other examples though. – Lars Moe Apr 29 '17 at 16:35
  • Justa a not, In that sample function, I'm attaching a file to test-sets – Barney Apr 29 '17 at 18:03
  • I noticed. What ALM/API Version is this? The content seems quiet a lot less than is required for 12.21 / .NET HttpWebRequest. – Lars Moe Apr 29 '17 at 20:03
  • It's alm version 12.50 – Barney Apr 29 '17 at 23:47
  • Do you know if the REST endpoints are the same in 12.21 as in 12.50? I see some conflicting information online. Do you know the exact format of the request needed? I am using Fiddler to see exactly what the request contains, but a lot of conflicting info online about this as well. HP themselves have this for 12.50 under "Post example:" http://alm-help.saas.hp.com/en/12.50/api_refs/REST/attachments.htm – Lars Moe Apr 30 '17 at 08:54

1 Answers1

0

Please have a look at this old post: HP ALM 11 Upload attachment using PHP and cURL

You need just to post correctly the attachment as explained. In case is needed I can provide a better description.

The link passed from github is a complete UI to use HP REST API that is quite too much in this case!

Have a nice day.

Community
  • 1
  • 1
Marco smdm
  • 1,020
  • 1
  • 15
  • 25