How i can set header header in multipart/form-data POST request?
When i sent POST request with file and header "Content-Type: multipart/form-data" , and via curl: curl -i -X POST -H "Content-Type: multipart/form-data" -F "file=@/home/Za_Dolber/abon19.txt" http://somehost.somedomain:9876/service/add?ids=1 i see something like this in Wireshark: POST /service/add?ids=1 HTTP/1.1 Host: somehost.somedomain:9876 User-Agent: curl/7.47.0 Accept: */* Content-Length: 200 Expect: 100-continue Content-Type: multipart/form-data; boundary=------------------------c47979a9d477ee1d HTTP/1.1 100 Continue --------------------------c47979a9d477ee1d Content-Disposition: form-data; name="file"; filename="abon19.txt" Content-Type: text/plain 1234567890 --------------------------c47979a9d477ee1d-- HTTP/1.1 200 OK Content-Type: text/plain Content-Length: 2 ok But when i send same request via SoapUI: POST /service/add?ids=1 HTTP/1.1 Accept-Encoding: gzip,deflate Content-Type: multipart/form-data; boundary="----=_Part_0_1598092424.1491306778334" MIME-Version: 1.0 Content-Length: 269 Host: somehost.somedomain:9876 Connection: Keep-Alive User-Agent: Apache-HttpClient/4.1.1 (java 1.5) ------=_Part_0_1598092424.1491306778334 Content-Type: text/plain; charset=UTF-8; name=abon18.txt Content-Transfer-Encoding: binary Content-Disposition: form-data; name="abon18.txt"; filename="abon18.txt" 1234567890 ------=_Part_0_1598092424.1491306778334-- HTTP/1.1 400 Bad Request Content-Type: text/plain Content-Length: 47 Bad Request you must specify file with abonents If i try set whole header field in "Headers" i get that header only in first part of request, like this: POST /service/add?ids=1 HTTP/1.1 Accept-Encoding: gzip,deflate Content-Type: multipart/form-data; boundary="----=_Part_1_662240902.1491314924683" MIME-Version: 1.0 Content-Disposition: name="file"; filename="abon18.txt" Content-Length: 267 Host: somehost.somedomain:9876 Connection: Keep-Alive User-Agent: Apache-HttpClient/4.1.1 (java 1.5) ------=_Part_1_662240902.1491314924683 Content-Type: text/plain; charset=UTF-8; name=abon18.txt Content-Transfer-Encoding: binary Content-Disposition: form-data; name="abon18.txt"; filename="abon18.txt" 79067212518 ------=_Part_1_662240902.1491314924683-- HTTP/1.1 400 Bad Request Content-Type: text/plain Content-Length: 47 Bad Request you must specify file with abonents How can i change value of "name" field in Content-Disposition header?Solved14KViews0likes2CommentsSoapUI Java API sending simple Http POST
Hi, I'm using Soap UI java API for some basic functionality, such as sending soap requests and running a wsdl mock service. Now however I want to simply create a default project; a test suite; a test case and a http request test step. But I can't find out how to go about this using the Java API. Since I have no wsdl I only want to maka a simple HTTP POST call. Setting this up in SoapUI gui, no problems but I don't get which java methods to use when doing this programmatically. Can anyone give me a pointer, or two? Thanks in advance! // Nisse BakkerudSolved4.5KViews0likes3CommentsHow to make transfer data to post query string in json format
I try to make data transfer from first post request (response from it in json) to second (request in second method in multiform/data type, but query param contain Json array). I need to past value like "4e2c056931d398831128ad2c6a45ec91" in second post request as querystring param mediaIds: [{"mediaId":"54a985e73f0f9360039750aac89d0133","type":0}]where "type":0 just static parameter. How can I do it?Can I do it via target request? Or I must use "Property expansion"? or maybe it is impossible without Groovy? P.S. I haven't any problem with parse response from first request, but I don't know how to transform it in json array that I need =(1.2KViews0likes0Comments