Hello All
I am trying to execute webservice from RPG with multipart formdata. Below is request which I am trying but getting (RESTEASY007500: Could find no Content-Disposition header within part) in debuglog. I tried to include header until content-type and rest is formatted in body.
Can someone please help if boundary should be part of header or body? I am using http_url_post_raw to create header and body
Using postman below request is working fine but when doing it from as400 it is failing.
Below is postman HTTP generated code:
Header: in RPG
POST /webpost HTTP/1.1
Host: d.testing.com
Authorization: Basic password
Cookie: sessioncookie
Content-Length: 1747
Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW
Body: in RPG
----WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="options"
Content-Type: application/json
{
"requestId": "b2f3021d-b53b-4a75-9ff9-085e6b64d3c0",
"importOption":{
"importType": "IMORT_CANGES",
"filename" : "Testing.xml",
"activateConflictFileGeneration" : true,
"createWorkspace" : true,
"importVersion": "WORKING"
},
"versionOption": {
"label": "Test_V_2",
"date": 1607987202358,
"description": "Test V 2"
},
"notifOption":{
"notifEmail": {
"smtpHost": "smtp.comp.com",
"smtpPort": 25,
"from": "test@comp.com",
"to": ["test@gmail.com"],
"subject": "Result Process E : ${requestId}",
"body": "Transaction ${requestId} : <br/> Started : ${startDate}, Ended : ${endDate} <br/> Status: ${status} <br/> ${errorMessage} <br/> Export slotid : ${extD}"
}
}
}
----WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="importFile"; filename="/C:/Users/Test1.xml"
Content-Type: <Content-Type header here>
(data)
----WebKitFormBoundary7MA4YWxkTrZu0gW
I am trying to execute webservice from RPG with multipart formdata. Below is request which I am trying but getting (RESTEASY007500: Could find no Content-Disposition header within part) in debuglog. I tried to include header until content-type and rest is formatted in body.
Can someone please help if boundary should be part of header or body? I am using http_url_post_raw to create header and body
Using postman below request is working fine but when doing it from as400 it is failing.
Below is postman HTTP generated code:
Header: in RPG
POST /webpost HTTP/1.1
Host: d.testing.com
Authorization: Basic password
Cookie: sessioncookie
Content-Length: 1747
Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW
Body: in RPG
----WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="options"
Content-Type: application/json
{
"requestId": "b2f3021d-b53b-4a75-9ff9-085e6b64d3c0",
"importOption":{
"importType": "IMORT_CANGES",
"filename" : "Testing.xml",
"activateConflictFileGeneration" : true,
"createWorkspace" : true,
"importVersion": "WORKING"
},
"versionOption": {
"label": "Test_V_2",
"date": 1607987202358,
"description": "Test V 2"
},
"notifOption":{
"notifEmail": {
"smtpHost": "smtp.comp.com",
"smtpPort": 25,
"from": "test@comp.com",
"to": ["test@gmail.com"],
"subject": "Result Process E : ${requestId}",
"body": "Transaction ${requestId} : <br/> Started : ${startDate}, Ended : ${endDate} <br/> Status: ${status} <br/> ${errorMessage} <br/> Export slotid : ${extD}"
}
}
}
----WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="importFile"; filename="/C:/Users/Test1.xml"
Content-Type: <Content-Type header here>
(data)
----WebKitFormBoundary7MA4YWxkTrZu0gW





Comment