Forum Discussion

bik's avatar
bik
Occasional Contributor
7 years ago
Solved

Trying 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.

 

  • Hi bpistole,

     

    I guess the APIs, which aren't shown in the coverage report, are added from Swagger in ReadyAPI 2.2.0 or later  (they are stored as-is in the project). Unfortunately, coverage isn't currently supported for such APIs. It's supported only for REST APIs, which are stored in the WADL format. 

     

    We have a corresponding item in our DB for implementing the coverage for Swagger.

     

     

7 Replies

  • Is there anything more in the response? An error message maybe? Don't you have access to the application's logs? I guess there are many problems that can be signaled by the 400 status response...

  • bik's avatar
    bik
    Occasional Contributor

    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: chunked

    • Lucian's avatar
      Lucian
      Community Hero

      Can't put my finger on it. Again, there can be multiple causes for this. Can't you access the application's logs?