M
M
Misha Kogan2015-06-13 12:11:20
JavaScript
Misha Kogan, 2015-06-13 12:11:20

How to pass xml posts requests to node.js? And how to handle the response?

How to pass xml posts requests to node.js? And how to handle the response?
Please tell me where you can read in detail, or maybe you can write an example code yourself, thanks in advance for all the answers.
Request example:

URL для передачи запроса:	http://shop.digiseller.ru/xml/shop_categories.asp
<digiseller.request>
  <seller>
    <id>505197</id>
  </seller>
  <category>
    <id></id>
  </category>
  <lang></lang>
</digiseller.request>


Answer example:
<digiseller.response>
<retval></retval>
<retdesc></retdesc>
<categories>
  <category cnt="" sub="">
    <id></id>
    <name></name>
  </category>
  <category cnt="" sub="">
    <id></id>
    <name></name>
      <category cnt="" sub="">
        <id></id>
        <name></name>
        ...
      </category>
  </category>
  ...
</categories>
</digiseller.response>

Answer the question

In order to leave comments, you need to log in

2 answer(s)
T
Timur Shemsedinov, 2015-06-13
@MarcusAurelius

XML is evil, with JSON there is absolutely no reason to use it unless it's for compatibility with old and legacy applications. There is a parser for the node: https://github.com/fb55/htmlparser2/

V
Vitaly Sivkov, 2015-06-14
@Sivkoff

Perhaps this is suitable (if you need shaping and parsing xml): https://github.com/dylang/node-xml
Or if you need only parsing: https://github.com/Leonidas-from-XIV/node-xml2js

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question