Contributions
Re: Trying to send a attachment in POST request
HTTP/1.1 400 Bad Request Date: Mon, 25 Jun 2018 11:17:55 GMT Server: Apache Cache-Control: no-cache, no-store, max-age=0, must-revalidate Pragma: no-cache Expires: 0 X-XSS-Protection: 1; mode=block X-Frame-Options: DENY X-Content-Type-Options: nosniff Set-Cookie: JSESSIONID=-BFD1zwe2dw5rQvpPwfFqcjf.hfs-support-service_test_0; Path=/domain X-Application-Context: application Connection: close Transfer-Encoding: chunked6 years agoPlace ReadyAPI QuestionsReadyAPI Questions3.4KViews0likes5CommentsTrying to send a attachment in POST request
Below is the Curl . curl -X POST --header 'Content-Type: multipart/form-data' --header 'Accept: application/json' {"type":"formData"} 'http://domain/users/users/import' While doing this am getting a 400 Bad Request. The request body is as below but all are optional parameter. { "user": "string", "Time": "2018-06-25T09:50:43.461Z", "Data": "string", "FileName": "string", "Status": "string", "TotalUsers": 0, "UnassignUsers": 0, "UniqueUsers": 0, "UpdatedUsers": 0, "UserLogId": 0 } After selecting the Media-Type as multipart/form-data ,attaching xml file and hitting post in SoapUI.Solved6 years agoPlace ReadyAPI QuestionsReadyAPI Questions3.5KViews0likes7CommentsRe: extracting location header from raw response and using that as a endpoint for next step in a request
Thanks for the solution. I did like this because the location header value for my next request would be the endpoint . def vals = testRunner.testCase.getTestStepByName("TC_POST_EXTUSER").httpRequest.response.responseHeaders["Location"][0] def groovyUtils = new com.eviware.soapui.support.GroovyUtils(context) return vals GETV.setPropertyValue('Endpoint',vals) thanks a lot Lucina for that [0] ,i could able to get rid off the square brackets. (which was my latest problem)6 years agoPlace ReadyAPI QuestionsReadyAPI Questions2.8KViews2likes0Commentsextracting location header from raw response and using that as a endpoint for next step in a request
The response is of a post HTTP/1.1 201 Created Date: Fri, 15 Jun 2018 08:01:27 GMT Server: Apache Cache-Control: no-cache, no-store, max-age=0, must-revalidate Pragma: no-cache Expires: 0 X-XSS-Protection: 1; mode=block X-Frame-Options: DENY X-Content-Type-Options: nosniff Set-Cookie: JSESSIONID=2YCtIlPMfCYNO3mQ3V2AlGqu.hfs-support-service_test_0; Path=/hfs-support-service X-Application-Context: application Location:http://xx/abcde Keep-Alive: timeout=6, max=69 Connection: Keep-Alive the groovy script is used to extract the location which is working fine def vals = testRunner.testCase.getTestStepByName("TC_POST_EXTUSER").httpRequest.response.responseHeaders["Location"] def groovyUtils = new com.eviware.soapui.support.GroovyUtils(context) groovyUtils.setPropertyValue("Request2", "Endpoint", vals.toString()) but while trying to use the extracted location header value in next request with a null pointer exception. I would like the endpoint of next request to be populated with the value.6 years agoPlace ReadyAPI QuestionsReadyAPI Questions2.9KViews0likes6Comments