You are not logged in.
Pages: 1
Hi ab,
As for now both windows-related HTTP-client classes (TWinINet, TWinHTTP)
add hard-coded Accept: */* header in their InternalCreateRequest methods.
It's ok for most cases, but when I try to customize Accept header in my
GET / POST requests - the WinHTTP library append the new value
to this */* but not replace it.
As the result I'm unable to set Accept header to required exact value:
the */* prefix is always hardcoded.
InHeaders := 'Accept: application/x-json-stream';
...Request(..., InHeaders, ...)
Expected HTTP Packet header:
Accept: application/x-json-stream
Actual HTTP Packet header:
Accept: */*, application/x-json-stream
To keep the full backward capability with the current implementation
the TWinHttpAPI.NoAllAccept property added to have an ability
to exlude this */* hardcoded value.
Please check pull request #307.
Last edited by Eugene Ilyin (2020-04-12 03:04:54)
Offline
Offline
pull@request:~307$ tracert ab
Tracing route to Arnaud Bouchez [62.210.254.173]
over a maximum of 3 hops:
1 72 ms 72 ms 72 ms 51.158.8.71
2 72 ms 71 ms 71 ms 51.158.8.83
3 67 ms 67 ms 67 ms 62-210-254-173.rev.poneytelecom.eu [62.210.254.173]
Trace complete.
Hm...
Offline
Hi, Eugene,
Perhaps your pullrequest has not been merged, due to more things being changed than just addition of NoAllAccept property.
Do you need this modification to make "standalone" requests?
I believe the mORMot HTTP clients is not very flexible to be used outside the ORM.
Perhaps intentionally.
That's why I don't use it to access resources not related to the ORM. I use Delphi / FPC clients or SynCurl which are now a separate unit.
Offline
@macfly,
No, I think that issues is that ab is busy now with v2 migration.
No rush - just pinging him from time to time
#307 is fully backward capatible and solve 2 issues:
1. Hardcoded Accept: */*
2. Add QueryDataAvailable before ReadData (see separate forum topic ralated to it)
Both changes are minor (add couple of lines) and related only to Windows API.
I believe the mORMot HTTP clients is not very flexible to be used outside the ORM.
Let me disagree with you: mORMot HTTP Client Requests are good for feeds fetching and cancelling, cancellation of long requests, support of Brotli compression and many other applications compared to simple call of remote REST endpoint.
I can solve almost anything with inheritance, except hardcoded values or missing of QueryDataAvailable which is required.
#307 just fix this without any regression or changes in app code.
Offline
Pages: 1