J
J
Javasavr2019-04-25 00:01:07
JSON
Javasavr, 2019-04-25 00:01:07

How to fix error: Unexpected identifier - in json POST request?

There is a NodeJS program that should send POST requests to a specific url and at the same time contain json data, the program works, but when I put a dash in the json data (for example: mobile-links-tel), the program gives an error: Unexpected identifier - and swears on a dash (using the request library)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
davidnum95, 2017-03-20
@nuclear_kote

You need to bind the context.

constructor(props, context) {
    super(props, context);
    this.onRegionChange = this.onRegionChange .bind(this);
  }

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question