I
I
Ivan Ivanov2017-08-04 10:00:56
Node.js
Ivan Ivanov, 2017-08-04 10:00:56

How to parse string with parameters in NODE.JS?

Hello.
A third-party service sends POST requests to my script, the body of which contains a line like:


callid = d4fc804c-d0dd-4fce- a47b-de5909bf40c6 & cmd = contact & crm_token = e44a5d5c-b53c-410b-9fc1-390e3a61d964 & phone = 79,999,999,999
callid = d4fc804c-d0dd-4fce- a47b-de5909bf40c6 & cmd = event & crm_token = e44a5d5c-b53c-410b-9fc1-390e3a61d964 & diversion = 79999999999 & ext =701&phone=79999999999&type=INCOMING&[email protected]

how do i get that string from the query and parse it into separate variables? If possible, an example without using Express and using it.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
Konstantin Kitmanov, 2017-08-04
@Yausi

Have you tried looking at the official documentation first?)
https://nodejs.org/dist/latest-v8.x/docs/api/query...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question