Error in REST API call to upload script to PC

Getting error in uploading Vugent script to PC via PC REST API

 

web_add_header("Authorization", "Basic bqweddqc3RlcjpDcm93bjIwMDk=");
    web_rest("PCS-SignIn",
        "URL=http://{PCSERVER}/LoadTest/rest/authentication-point/authenticate",
        "Method=GET",
        HEADERS,
          "Name=Authorization", "Value=Basic bqweddqc3RlcjpDcm93bjIwMDk=",
        ENDHEADER,
        LAST);
       
       
       web_add_header("Content-Type", "multipart/form-data");
       
    web_submit_data("AddAttachment.aspx",
        "Action=http://{PCSERVER}/LoadTest/rest/domains/testdomain/projects/test/Scripts/",
        "Method=POST",
        "EncType=multipart/form-data",
        "RecContentType=multipart/form-data",
        "Snapshot=t7.inf",
        "Mode=HTML",
        ITEMDATA,
        "Name=ProductAPIv3.1", "Value=C:\\temp\\SearchAPIv7.3.zip", "File=yes", ENDITEM,
        "Name=", "Value=<Script xmlns\=\"http://www.hp.com/PC/REST/API\"><TestFolderPath>Subject\Temp</TestFolderPath><Overwrite>true</Overwrite><RuntimeOnly>true</RuntimeOnly></Script>", ENDITEM,
    LAST);

 

Response:

Action.c(24): t=4930ms: 152-byte response body for "">pctrappprodvh2/.../" (RelFrameId=1, Internal ID=2)
Action.c(24): <Exception xmlns="http://www.hp.com/PC/REST/API">\r\n
Action.c(24): <ExceptionMessage>Operation failed.</ExceptionMessage>\r\n
Action.c(24): <ErrorCode>1001</ErrorCode>\r\n
Action.c(24): </Exception>
Action.c(24): Error -26612: HTTP Status-Code=500 (Internal Server Error) for "">pctrappprodvh2/.../" [MsgId: MERR-26612]

 

Let me know, if anyone has working sample to upload script via REST API call?

 

Thanks