Rest api

  • Unknown's avatar

    Hello. I am retrieving the posts from my blog through the rest api in an Angular app, through the $http service.
    The problem I am having is that:
    1. The double quotes are returned in the form of “ and ”
    2. The body (or content of the post) is returned with the html tags. Eg:
    <p lang=’en-US’ style=’text-align:justify;’>Commenting on Galatians 6:1, 2, (NAB) which says, “my brothers, if someone is detected in sin, you who live by the spirit should gently set him right, each of you trying to avoid falling into temptation himself. Help carry one another’s burdens; in that way you will fulfill the law of Christ”, John R. W. Stott writes:</p> <p lang=’en-US’ style=’text-align:justify;’><span style=’line-height:1.5;’>

    I have searched a lot, but I did not manage to solve these problems. Is there any way you can help?
    Thank you very much.

    My blog’s url:
    https://public-api.wordpress.com/rest/v1.1/sites/peribiblicum.wordpress.com/posts/?number=5&fields=title,content&pretty=true

    The blog I need help with is: (visible only to logged in users)

  • Unknown's avatar

    Here, the quotes are displayed properly. When I retrieve them in my app the are display like this:
    ως “ and ”

  • Unknown's avatar

    Actually, I found the solution. It is an Angular thing. I used the $sce service to render what I received from the api as trusted html.
    For future reference…

  • The topic ‘Rest api’ is closed to new replies.