question

TaylorReiner-7870 avatar image
0 Votes"
TaylorReiner-7870 asked MayankBargali-MSFT commented

Azure Logic App Simple Website Hit with HTTP

Hello, I'm simplying trying to hit a open api like this:
93239-image.png

The api: https://api.geekdo.com/xmlapi/boardgame/3

When I run this I get: BadRequest. Http request failed: 'The character set provided in ContentType is invalid. Cannot read content as string using an invalid character set.'.

Is there something I should be setting?

Thanks a ton for any help :)



azure-logic-apps
image.png (77.0 KiB)
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @TaylorReiner-7870

Welcome to Microsoft Q&A! Thanks for posting the question.
I was able to repro the issue at my end. As per the initial analysis looks like the endpoint does not accept the "Accept" header as I have tested it passing the Accept header with "application/xml; charset=utf-8" while making the GET call from the logic app. I will be reaching out to my team for their further input.

1 Vote 1 ·

Thanks so much for the help, Mayank!

0 Votes 0 ·

1 Answer

MayankBargali-MSFT avatar image
1 Vote"
MayankBargali-MSFT answered MayankBargali-MSFT commented

Hi @TaylorReiner-7870

Apology for the delay.
I have got the confirmation as the HTTP endpoint didn't accept the "Accept" header this is the expected behavior. As the logic app is built on top of the Azure function .NET version and internally it using HttpContent to create the HTTP request and we do see an issue with dot net HttpContent.

If you don't have access to the HTTP endpoint and cannot change the HTTP endpoint to accept the "Accept" header then alternatively you can use the logic app (preview) which is built on top of dot net core and I tested your HTTP endpoint and I don't see any issue while using HTTP action for the logic app (preview).

· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hey Mayank,

No worries and thanks for the help!

I've looked around logic app (preview) and the functionality doesn't seem 1-to-1 with logic apps.

To give an overview of what I'm trying to do: I just want a logic app to run every hour and ping a certain site. The site in the example was just an example. Is there a good task (step or operation) in the logic app editor that can ping a site and return with an http code on successful ping or not?

Thanks, Taylor

0 Votes 0 ·

@TaylorReiner-7870 You can try leveraging logic app scheduler that you can schedule every hour (according to your need) then use HTTP actions. If your endpoint is the same then make sure that your endpoint accept the "Accept" header.

0 Votes 0 ·