Send CSV to an API using POSTMAN

1

I am using Symfony 3 to create an API that receives a CSV file and reads it. This is my route:

/**
 * Recive a file
 *
 * @Route("/get/file", name="get-file")
 * @Method("POST")
 * @param Request $request
 * @return Response
 */
 public function getFileAction (Request $request) {

    return $this->json(array(
       'status' => 'success',
       'code' => 200,
       'data' => $request,
    ));
 }

I have created a Collection in Postman that calls me to this route and returns the data correctly:

I tried to pass the CSV using the following form:

  • How can I send a CSV to an API using POSTMAN or another service?

  • How could I do some tests?

asked by Oskar 17.01.2018 в 14:51
source

1 answer

0

Try your POST request by sending the file like this:

    
answered by 17.01.2018 в 16:27