Jump to content

KBazX

Members
  • Content Count

    22
  • Joined

  • Last visited

Community Reputation

0 Neutral
  1. KBazX

    Send data to the server

    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:
  2. KBazX

    Send data to the server

    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.
  3. KBazX

    Send data to the server

    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.
  4. KBazX

    Send data to the server

    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.
  5. KBazX

    Send data to the server

    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?
  6. 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;
  7. Unfortunately, I do not have the opportunity to influence the developers of the web service. Thank you so much for your work!
  8. 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.
  9. 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.
  10. 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?
  11. I'm doing this in the OnStateChange-event for now. I'm tracking states httpDnsLookupDone and httpBodyReceived.
  12. 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.
  13. I'm sorry, I phrased the question incorrectly. I meant the duration of the request execution by the server.
×