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?Solved14KViews0likes2CommentsHow to pass array of strings in post body?
Hi everyone, I'm trying to get my Swagger UI 3.17.1 POST operation to take a JSON array of strings but am currently getting a runtime error from Symfony/API Platform:"Invalid value provided (invalid IRI?)." I'd appreciate any help on how to get my configuration working. Here is my current YAML configuration: zooniverse-datasheets: method: 'POST' path: '/projects/{id}/zooniverse/datasheets' controller: 'App\Controller\ZooniverseSendDatasheetsAction' # read: false swagger_context: summary: Send project's datasheet(s) to Zooniverse parameters: - in: path name: id required: true type: string - in: body name: datasheets required: false schema: type: array items: type: string example: ["ID1", "ID2", "ID3"] # description: list of datasheet IDs in JSON array format responses: '201': description: 'Success' '400': description: 'Invalid input' '404': description: 'Resource not found' and here is a screen shot of the operator so far: I'm pretty new to Swagger but have gotten other operators to work but having trouble with this one. Any help is greatly appreciated! thanks, Mona7.9KViews0likes3CommentsSoapUI 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.5KViews0likes3CommentsRedirect after Post-request not working / possible Post-request is wrong
Hello all I tried to do a post-request and after that I need to follow that redirect to get proper get actually. So I have a login request with "application/x-www-form-urlencoded" data, it's working perfectly in Postman. Now I'm trying to re-produce the same in ReadyApi (wish i could do this on soapui too), but something goes wrong. What's wrong, which settings should I change to follow the redirects and get proper response from server?Solved1.3KViews0likes2CommentsHow 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