Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Indy HTTP client- Need help on Overwriting HTTP method
#3
(03-04-2020, 07:56 PM)rlebeau Wrote:
(03-04-2020, 04:39 AM)happyzj Wrote: With Indy 10.6.1.518, I find idHTTP client doesn't have property "HTTPMethod" anymore and I tried following two property which doesn't work:
myhttp.Request.Method := 'SUBSCRIBE';
myhttp.Request.MethodOverride := 'SUBSCRIBE';

In order to specify a custom method, you will have to call TIdHTTP.DoRequest() directly. However, it is a protected method, so you will have to use an accessor class to reach it, eg:

Code:
type
  TIdHTTPAccess = class(TIdHTTP)
  end;

TIdHTTPAccess(form1.myhttp).DoRequest('SUBSCRIBE', URL, nil, nil, []);

Thank you very much Rlebeau, in this case, would the custom header set in form1.myhttp - "myhttp.Request.CustomHeaders.Add(header)"would still take effect?  thank you.
Reply


Messages In This Thread
RE: Indy HTTP client- Need help on Overwriting HTTP method - by happyzj - 03-04-2020, 08:00 PM

Forum Jump:


Users browsing this thread: 2 Guest(s)