cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
New Member

Remember to include a Content-Type header set to application/json in your request.

Hi

 

I am trying to create HTTP Request "When a HTTP request is recevied". Whenever i add "Request Body JSON Schema" the Flow designer prompts me "Remember to include a Content-Type header set to application/json in your request.". I know that i have to define the content-type but how to do it??

 

My Schema is as below

 

 
{
"type": "object",
"properties": {
"type": {
"type": "string",
"$id": "#/properties/type",
"title": "TheTypeSchema",
"default": "",
"examples": [
"profile"
],
"pattern": "^(.*)$"
},
"fired_at": {
"type": "string",
"$id": "#/properties/fired_at",
"title": "TheFired_atSchema",
"default": "",
"examples": [
"2009-03-2621:31:21"
],
"pattern": "^(.*)$"
},
"data[id]": {
"type": "string",
"$id": "#/properties/data[id]",
"title": "TheData[id]Schema",
"default": "",
"examples": [
"8a25ff1d98"
],
"pattern": "^(.*)$"
},
"data[list_id]": {
"type": "string",
"$id": "#/properties/data[list_id]",
"title": "TheData[list_id]Schema",
"default": "",
"examples": [
"a6b5da154"
],
"pattern": "^(.*)$"
},
"data[email]": {
"type": "string",
"$id": "#/properties/data[email]",
"title": "TheData[email]Schema",
"default": "",
"examples": [
"api@mailchimp.com"
],
"pattern": "^(.*)$"
},
"data[email_type]": {
"type": "string",
"$id": "#/properties/data[email_type]",
"title": "TheData[email_type]Schema",
"default": "",
"examples": [
"html"
],
"pattern": "^(.*)$"
},
"data[merges][EMAIL]": {
"type": "string",
"$id": "#/properties/data[merges][EMAIL]",
"title": "TheData[merges][email]Schema",
"default": "",
"examples": [
"api@mailchimp.com"
],
"pattern": "^(.*)$"
},
"data[merges][FNAME]": {
"type": "string",
"$id": "#/properties/data[merges][FNAME]",
"title": "TheData[merges][fname]Schema",
"default": "",
"examples": [
"MailChimp"
],
"pattern": "^(.*)$"
},
"data[merges][LNAME]": {
"type": "string",
"$id": "#/properties/data[merges][LNAME]",
"title": "TheData[merges][lname]Schema",
"default": "",
"examples": [
"API"
],
"pattern": "^(.*)$"
},
"data[merges][INTERESTS]": {
"type": "string",
"$id": "#/properties/data[merges][INTERESTS]",
"title": "TheData[merges][interests]Schema",
"default": "",
"examples": [
"Group1,Group2"
],
"pattern": "^(.*)$"
},
"data[ip_opt]": {
"type": "string",
"$id": "#/properties/data[ip_opt]",
"title": "TheData[ip_opt]Schema",
"default": "",
"examples": [
"10.20.10.30"
],
"pattern": "^(.*)$"
}
},
"definitions": {},
"$schema": "",
"$id": "http://example.com/root.json",
"title": "MailChimp",
"default": null,
"required": [
"type",
"fired_at",
"data[id]",
"data[list_id]",
"data[email]",
"data[email_type]",
"data[merges][EMAIL]",
"data[merges][FNAME]",
"data[merges][LNAME]",
"data[merges][INTERESTS]",
"data[ip_opt]"
]
}
 
And My Payload is as below
 
{
"type": "profile",
"fired_at": "2009-03-26 21:31:21",
"data[id]": "8a25ff1d98",
"data[list_id]": "a6b5da154",
"data[email]": "api@mailchimp.com",
"data[email_type]": "html",
"data[merges][EMAIL]": "api@mailchimp.com",
"data[merges][FNAME]": "MailChimp",
"data[merges][LNAME]": "API",
"data[merges][INTERESTS]": "Group1,Group2",
"data[ip_opt]": "10.20.10.30"
}
1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: Remember to include a Content-Type header set to application/json in your request.

Hi @majidb,

 

I am sorry that the link provided does not actually help you, and my explanation above may also confuse you.

 

I mean there is no problem with the flow created by the content you provide. At least the format is in line with the requirements of Flow creation.

 

The flow designer prompts that after you create this flow, you need to include a Content-Type header set to application/json in your request when you send the Http request, such as when you test or send an http request to trigger the flow, not adding a Content type here.

 

For example, using postman to create and send an http request, you could edit the request parameter and the content type header, and add the content type here.

 

4.PNG

 

Please take a try.

 

Best Regards,

Barry

 

 

 

 

 

 

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
Highlighted
Community Support
Community Support

Re: Remember to include a Content-Type header set to application/json in your request.

Hi @majidb,

 

I have made a test on my side using the Schema and Payload you provided and there are indeed such tips, but this is not your flow design error,  just a hint from Flow Designer.

 

When you are editing your Http request, you need to include a Content-Type header.

 

You could click on "Do not show again" and there will be no such prompts in the future.

 

If you want to define the content-type, you can refer to the following link:

 

https://docs.microsoft.com/en-us/azure/logic-apps/logic-apps-content-type

 

Please take a try and let me know if issue still exist.

 

Best Regards,

Barry

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Highlighted
New Member

Re: Remember to include a Content-Type header set to application/json in your request.

Thanks Barry for your reply.

 

I have been through this page, it says that "make sure you include a Content-Type header and set the header's value to application/json" but it does not show where and how?

 

I added below line above my Schema right on the top as 1st line but it did throw errors

 

Content-Type: application/json
Highlighted
Community Support
Community Support

Re: Remember to include a Content-Type header set to application/json in your request.

Hi @majidb,

 

I am sorry that the link provided does not actually help you, and my explanation above may also confuse you.

 

I mean there is no problem with the flow created by the content you provide. At least the format is in line with the requirements of Flow creation.

 

The flow designer prompts that after you create this flow, you need to include a Content-Type header set to application/json in your request when you send the Http request, such as when you test or send an http request to trigger the flow, not adding a Content type here.

 

For example, using postman to create and send an http request, you could edit the request parameter and the content type header, and add the content type here.

 

4.PNG

 

Please take a try.

 

Best Regards,

Barry

 

 

 

 

 

 

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Highlighted
Administrator
Administrator

Re: Remember to include a Content-Type header set to application/json in your request.

Hello, @majidb!

 

Thank you for posting on the Flow Community Forum! Have you had an opportunity to apply @v-bacao-msft‘s recommendation to adapt your Flow? If yes, and you find that solution to be satisfactory, please go ahead and click “Accept as Solution” so that this thread will be marked for other users to easily identify!


Thank you for being an active member of the Flow Community!

 

-Gabriel
Flow Community Manager

- Gabriel
Community Manager
Power Automate | Power Virtual Agents
Super User Program Manager
Power Platform Communities

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

Upcoming Events

Experience what’s next for Power Automate

See the latest Power Automate innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Top Solution Authors
Top Kudoed Authors
Users online (6,783)