

KBazX
Members-
Content Count
22 -
Joined
-
Last visited
Everything posted by KBazX
-
The OverbyteIcsHttpPost1.pas file contains an example of how to use the SendStream property. But, as I understand, this is not applicable to TSslHttpRest? The RestRequest function contains the line of code: FSendStream := Nil;
-
There is also a strange ambiguity in the documentation from Mozilla. https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Methods/DELETE On one side it says: And also below:
-
I understand. I'm just talking about an alternative. Either generate the request body manually, or automatically with the help of auxiliary components. For general cases, a component is used. If the case is with logic that is not provided by the component, then generate the request body manually.
-
Yes, the need for a request body is clearly described in the api documentation. This is logical - otherwise how to send a request to delete a hundred, a thousand, ten thousand items? As I understand it, such a number of parameters will not fit in the url. In my task, for example, I delete three thousand elements. I think I succeeded. In the OnSessionConnected handler, I assign the necessary values to the SendStream and ContentTypePost properties. In general, this scheme already works. Therefore, the component does not need to be changed. The only thing I would like, if possible, to have some low-level properties that could be used to manually generate the contents of the request body without using auxiliary tools such as the TRestParams class. This will still allow me to solve my own problems when there is logic that cannot be implemented using TRestParams.
-
Could you please tell me how to do it manually? Maybe there is some example? The Send Stream property didn't work for me for the above reason.
-
I need to send a json array like this as the request body: [{"id": "0ab67665-49a7-4bd4-b111-8363b9ca07ba"},{"id": "3d9ebfd5-249f-468e-bcc5-6d5cb93f9ff6"},{"id": "a2b10f76-2218-41f2-b962-10f295c992d1"}] I try this code: HttpRest.RestParams.PContent := PContBodyJson; HttpRest.RestParams.AddItem('id', '0ab67665-49a7-4bd4-b111-8363b9ca07ba', RPTypeStr); HttpRest.RestParams.AddItem('id', '3d9ebfd5-249f-468e-bcc5-6d5cb93f9ff6', RPTypeStr); HttpRest.RestParams.AddItem('id', 'a2b10f76-2218-41f2-b962-10f295c992d1', RPTypeStr); The result is this request: DELETE /api/items?{"id":"a2b10f76-2218-41f2-b962-10f295c992d1"} HTTP/1.0 That is, the array is not created due to the fact that in the TRestParams.AddItem function there is a call: Index := IndexOf(aName); It does not allow adding elements with the same name. And the data itself is transmitted not in the request body, but in the url. Please tell me how to do it correctly?
-
The TSslHttpRest.GetResponseJson function cannot process json of the following type: [] ["aaa"] ["aaa", "bbb"] In theory, we should add an analysis of the presence of square brackets in the resulting string to this function.
-
TSslHttpRest.GetResponseJson and json array
KBazX replied to KBazX's topic in ICS - Internet Component Suite
Unfortunately, I do not have the opportunity to influence the developers of the web service. Thank you so much for your work! -
TSslHttpRest.GetResponseJson and json array
KBazX replied to KBazX's topic in ICS - Internet Component Suite
I just had this situation. I requested an array of objects from the web service, but specified the incorrect range of the array index. The web service returned an empty array. -
Did I understand correctly that it makes no sense to use the OnDocData event for the TSslHttpRest component, since TSslHttpRest certainly uses the RcvdStream property of its ancestor TSslHttpCli?
-
Clearly! Thanks!
-
Header Last Modifed to TDateTime
KBazX replied to chmichael's topic in ICS - Internet Component Suite
RespLastModDT -
TSslHttpRest - How can I get web server response time?
KBazX posted a topic in ICS - Internet Component Suite
Subj -
TSslHttpRest - How can I get web server response time?
KBazX replied to KBazX's topic in ICS - Internet Component Suite
I'm doing this in the OnStateChange-event for now. I'm tracking states httpDnsLookupDone and httpBodyReceived. -
TSslHttpRest - How can I get web server response time?
KBazX replied to KBazX's topic in ICS - Internet Component Suite
I just need the total time it takes to get a response from the web service. That is, taking into account network delays, web server delays, etc. -
TSslHttpRest - How can I get web server response time?
KBazX replied to KBazX's topic in ICS - Internet Component Suite
I'm sorry, I phrased the question incorrectly. I meant the duration of the request execution by the server. -
ICS V9.3 I execute a test http-request with the MaxBodySize property with a value that is obviously less than the response size. I noticed the following errors: - Events OnRestRequestDone and OnRequestDone are executed twice. - In repeating events, the property ReasonPhrase has a repeating status code. ................ ................ ................ HttpRest - DocEnd HttpRest - RestRequestDone RqType: GET ErrCode: 3 Error: RequestDoneErrorStr: Aborted StatusCode: 404 ReasonPhrase: "404 Aborting connection, Body Size too Large: 369" HttpRest - RequestDone RqType: GET ErrCode: 3 Error: RequestDoneErrorStr: Aborted StatusCode: 404 ReasonPhrase: "404 Aborting connection, Body Size too Large: 369" HttpRest - RestRequestDone RqType: GET ErrCode: 3 Error: RequestDoneErrorStr: Aborted StatusCode: 404 ReasonPhrase: "404 404 Aborting connection, Body Size too Large: 369" HttpRest - RequestDone RqType: GET ErrCode: 3 Error: RequestDoneErrorStr: Aborted StatusCode: 404 ReasonPhrase: "404 404 Aborting connection, Body Size too Large: 369"
-
No. But there may be a bug.
-
OverbyteIcsLIBEAY.pas Version: 8.70 Function IcsX509VerifyErrorToStr function string: Result := String(AnsiString(X509_verify_cert_error_string(ErrCode))); If OpenSSL is not loaded, then IcsX509VerifyErrorToStr fails with an exception: ClassName: EAccessViolation. Message: Access violation at address 00000000. Read of address 00000000
-
But if the OpenSSL libraries are located next to the file, then the loading of OpenSSL is successful automatically.
-
If I dynamically create the TSslHttpCli component for only one request, then I don't control the OpenSSL loading process.
-
But it may depend on the URL.