Forum Discussion

bowenli's avatar
11 years ago

Need help with Http.client.request !

My Endpoint code is 

<-- endpoint start -->

 

<#assign response = http.client.request("http://feeds.news.com.au/public/rss/2.0/fs_breaking_news_13.xml").get()/>

<#if response.hasError>
${response.error.message}
</#if>

 

<--endpoint end-->

 

it returns "html found in response" , what does this mean? the syntax is correct , why does it throw error?

 

 

 

  •  Hi Bowen,

     

    I believe that it is for Fox Sports Australia project, I have updated some config from the backend. can you give a try again? it could be working now.

     

    Best Rgards

    /H

6 Replies

  • HaidongG's avatar
    HaidongG
    Lithium Alumni (Retired)
    11 years ago

     Hi Bowen,

     

    I believe that it is for Fox Sports Australia project, I have updated some config from the backend. can you give a try again? it could be working now.

     

    Best Rgards

    /H

  • I'm guessing your code snippet is missing the bit where you output the content of the response (or part of it).

  • bowenli's avatar
    bowenli
    Ace
    11 years ago
    working now ! we have scratched our heads for quite a while.
  • cblown's avatar
    cblown
    Boss
    11 years ago

    Related to the OPs request - does this xml() call exist?

     

    ${http.client.request(“https”,”some.api.url”,”/some/path”).xml().parameter(“paramName”,”paramValue”).post()}

     xml-call.png

  • YuriK's avatar
    YuriK
    Khoros Expert
    11 years ago

    Hey Chris,

     

    This is a good catch, we actually currently don't allow the .xml() call for http.client due to security concerns. I guess Doug and I forgot this when we were creating the presentation.

     

    I will raise this request with our product owner but I suggest you also add it to Lithium Ideas

     

    Sorry for the confusion,

     

    Yuri

     

  • Gursimrat's avatar
    Gursimrat
    Leader
    11 years ago
    Could you please provide more info regarding how it worked, a code snippet would be great.

    Thanks