Rolphy Reyes 0 Posted 19 hours ago I have Delphi Berlin (10.1) installed. I have to consume an API endpoint I've been using the Indy component suite and the Delphi native component suite TNetHTTPClient to send an XML file and the results are not what I expected; plus I'm very new to this. Using the component suites mentioned above I get all kinds of errors except those that the API should report. However, using the PostMan application, the API returns correctly. I haven't installed the ICS component suite yet, but I've run some of its examples, and the OverbyteIcsHttpRestTst.exe application example is pretty close to achieving what I need. If you look closely, you can see the error I get when attempting to send a message in the attached image. Can you help me resolve this issue? TIA Share this post Link to post
Remy Lebeau 1578 Posted 18 hours ago 18 minutes ago, Rolphy Reyes said: Using the component suites mentioned above I get all kinds of errors Such as? Can you be more specific? 18 minutes ago, Rolphy Reyes said: However, using the PostMan application, the API returns correctly What exactly are you entering into postman? 18 minutes ago, Rolphy Reyes said: Can you help me resolve this issue? Not without knowing what the endpoint is actually expecting, and what your actual code looks like that is not working for you. 1 Share this post Link to post
Angus Robertson 645 Posted 14 hours ago ICS is simply reporting a REST API error that says your XML contains an error. So you need to correct your XML. Or maybe you are using the wrong API? Angus Share this post Link to post
Cristian Peța 115 Posted 13 hours ago (edited) I understand from the error message that you need to send the file as a "xml" field and not directly in body. How it is working in PostMan? The XML is also in the body or you define a field named "xml" containing the file? Edited 12 hours ago by Cristian Peța typo Share this post Link to post
Rolphy Reyes 0 Posted 9 hours ago 2 hours ago, Cristian Peța said: I understand from the error message that you need to send the file as a "xml" field and not directly in body. How it is working in PostMan? The XML is also in the body or you define a field named "xml" containing the file? Hi! I attach an image of how sending the file works in Postman. Share this post Link to post
Rolphy Reyes 0 Posted 9 hours ago 8 hours ago, Remy Lebeau said: Such as? Can you be more specific? What exactly are you entering into postman? Not without knowing what the endpoint is actually expecting, and what your actual code looks like that is not working for you. Hi! Sorry, I can't describe the errors because I didn't save any pictures of them. Attached is an image of how it works in Postman. Share this post Link to post
Rolphy Reyes 0 Posted 9 hours ago 4 hours ago, Angus Robertson said: ICS is simply reporting a REST API error that says your XML contains an error. So you need to correct your XML. Or maybe you are using the wrong API? Angus Hi! My XML file is correct. And I'm using the correct URL. What I don't know is how to add the parameter from the OverbyteIcsHttpRestTst.exe application, just like Postman does. Share this post Link to post
Rolphy Reyes 0 Posted 9 hours ago Hi! I'm sorry if I wasted your valuable time. But I found the right way to send the file. I think I was too exhausted and didn't understand the entire example. Anyway, thank you very much. This time, ICS saved my life. Share this post Link to post
Cristian Peța 115 Posted 9 hours ago 5 minutes ago, Rolphy Reyes said: But I found the right way to send the file. How I supposed, as a field and not directly into the body. 1 Share this post Link to post