Home » Java » java – HTML entities incorrectly encoding in API call-Exceptionshub

java – HTML entities incorrectly encoding in API call-Exceptionshub

Posted by: admin February 23, 2020 Leave a comment

Questions:

I am about to use Paxful API method for sending a message to trade:

String message = "Do NOT PRESS 'Paid' button, until your transfer get 'Success' status.";
paxfulService.sendMessage(tradeId, message);

But here is what I see in the browser:

Screenshot of pop up with incorrectly formatted punctuation

This is my fault, or Paxful API use unnecessary HTML encoding?

How to&Answers:

The API you are using is re-encoding the single quotes back into their hex values.

In your original message string try using ' in the place of the single quotes you have.