thangchung / GrpcJsonTranscoder

A filter which allows a RESTful JSON API client to send requests to .NET web server over HTTP and get proxied to a gRPC service
MIT License
121 stars 26 forks source link

Could not merge query string and form data in PUT/PATCH request #6

Closed thangchung closed 4 years ago

thangchung commented 5 years ago

If we have the PUT request just like

http://localhost:5000/api/products/5D18B427-FF94-4D34-9C5A-D5312E407EB5

and form-data

{
    "name": "sample product 123",
    "desc": "This is sample project 12345",
    "price": "1200",
    "imageUrl": "http://samplepicture.img"
}

We would like to have a JSON object in the downstream service like

{
    "id": "5D18B427-FF94-4D34-9C5A-D5312E407EB5",
    "name": "sample product 123",
    "desc": "This is sample project 12345",
    "price": "1200",
    "imageUrl": "http://samplepicture.img"
}

Then, we always get the object with id is null

Solution: we would like to merge the query string and form data in PUT/PATCH requests

And, also Delete cannot work well becasue it always wants us to put into form-data. We would like to pass like DELETE http://localhost:5000/api/products/5D18B427-FF94-4D34-9C5A-D5312E407EB5

ref https://github.com/vietnam-devs/coolstore-microservices/issues/48

thangchung commented 4 years ago

Fixed with 0.5.0