curl convert issue
tc-maxx opened this issue · 3 comments
Hello,
I tried to convert the following curl to C#, but unfortunately I got an error
curl -H ':method: POST' -H ':path: /api' -H ':authority: www.holidaycheck.de' -H ':scheme: https' -H 'content-type: application/json' -H 'accept: /' --data-binary '{"requests":{"g0":{"resource":"all-offers-service","operation":"create","params":{},"body":{"facets":{"hotelIds":["e07f38d9-7bb1-47d5-9e6c-6fddae69f25b"]},"locale":"de_DE","currency":"EUR","package":{"transfer":[],"flight":{"departureAirports":["LEJ"],"directFlight":false},"travellers":{"adults":2,"children":[]},"mealTypes":["GT06-AI"],"roomTypes":[],"attributes":[],"numberOfRooms":1,"travelDates":{"departureDate":{"year":2019,"month":3,"day":30},"cols":10,"returnDate":{"year":2019,"month":4,"day":9},"minDuration":10,"maxDuration":10},"tourOperatorIds":[]},"resultSpec":{"pageSize":100,"sort":"totalPrice"}}}},"context":{}}' 'https://www.holidaycheck.de/api'
Hi @tc-maxx,
Fixed, please note, that curl ignores headers -H
with leading :
symbol, so you should remove it.
Please let me know if everything works as expected, feel free to reopen the issue.
Thank you.
Hi olsh,
Hello, thank you! The conversion works so far.
If the headers with leading : symbol are missing, the request will fail.
Do you have another idea?
BR Maxx
Hi Max,
You shouldn't remove the headers completely, you should just remove the leading :
char.
For instance -H ':scheme: https'
becomes -H 'scheme: https'