Quantcast
Channel: LoadRunner Practitioners Forum topics
Viewing all articles
Browse latest Browse all 3978

How to Submit jSON payload and .PDF file in one request

$
0
0

Hi,

I need to request request which should contain 2 parts. Below is what I created. while executing same thing, document is not added as part in request... can someone suggest what I can do to resolve this issue.

part1 - should have json payload followed by part 2 (Content Type - application/json)

Part2 - Should have .PDF file attached to it. (Content Typeapplication/octet-stream)

  web_custom_request("createPackage",
               "URL=XXX", 
                "Method=POST", 
                "Resource=0",
                "Mode=HTTP", 
                "RecContentType=application/json",               
                "EncType=multipart/form-data",
                "Body=------=_Part_95_423423423.142423423\r\n"
                    "Content-Disposition: form-data; name=\"metadata\"\r\n\n"
                    "{"
                      "XX"
                      ":["
                       "{"
                          XX
                        "}"
                      "],"
                     ["
                       
                      "]"
                    "}\r\n"
                    "------=__Part_95_423423423.142423423\r\n"
                    "Content-Type: application/pdf\r\n"
                    "Content-Disposition: form-data; name=\"docA\"; filename=docA.pdf",                    
                LAST);

 

Regards,

GK


Viewing all articles
Browse latest Browse all 3978

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>