I tried the
POSTMAN (https://www.getpostman.com/) for testing my REST web services. It
is a good tool and when I used it with the GET method all was ok but with the
POST method (I had to upload a photo), some problems occurred because I did not
understand how to use the Content-Type parameter. I tried to insert it in the “Headers”
tab with other parameters but it did not work.
The
solution is to select the form-data option in the “Body” tab, enter a type “File”
parameter and then you have to select the file for uploading.
Then if you
select the “Generate code snippet” you will see the Content-Type parameter like
this:
Content-Type: multipart/form-data;
boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW
Regards!
Nessun commento:
Posta un commento