This is a migrated thread and some comments may be shown as answers.

415 Unsupported Media type on REST .net Core

8 Answers 1604 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Trung
Top achievements
Rank 1
Trung asked on 24 Jan 2018, 03:58 AM

Following these guide: 

https://www.telerik.com/blogs/telerik-reporting-and-aspnet-core

https://docs.telerik.com/reporting/html5-report-viewer-asp-net-core-2

to create a REST service for Telerik Report, but whatever I do, I have always get this error:

Am I missing something?

 

 

 

 

 

8 Answers, 1 is accepted

Sort by
0
Accepted
Katia
Telerik team
answered on 26 Jan 2018, 04:51 PM
Hi Trung,

Test setting the content type when creating request in Postman as JSON(application/json). This suggestion is based on this stackoverflow thread where a similar problem is discussed.


Regards,
Katia
Progress Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Trung
Top achievements
Rank 1
answered on 31 Jan 2018, 12:17 AM

Hi Katia, 

I have already tried this before, it just doesn't matter. Except your HTML viewer provided in Telerik Reporting packages, all requests sent to  Telerik Report Services (running on .Net Core target .Net Framework) will result in 415 error.

I have tried to use Postman, pure Javascript, Jquery, Angular, Asp.Net Web Controller and all failed with 415.......

This does not happen if I have the Telerik Report Services running on Net Framework. 

Could you confirm with the Tech guy and give me some solution on this?. This is quite essential for me to get a demo example working for my company next meeting

Cheers

 

0
Trung
Top achievements
Rank 1
answered on 31 Jan 2018, 12:40 AM
Hi Katila,
I have figured out the problems. The cause is due to my setup and configuration of the project. Everything works now. 
Thanks for your help
0
Trung
Top achievements
Rank 1
answered on 31 Jan 2018, 12:40 AM
Hi Katila,
I have figured out the problems. The cause is due to my setup and configuration of the project. Everything works now. 
Thanks for your help
0
仁劭
Top achievements
Rank 1
answered on 30 May 2018, 10:08 AM

I got the same question 

can you tell me what the Body should I put in ?
give me some examples thx

0
Todor
Telerik team
answered on 04 Jun 2018, 08:13 AM
Hello 仁劭,

From the screenshot it seems that the Web service is running locally. It is not clear to me what is the service supposed to return, hence what the Body of the request should contain.
I suggest to check the How to: Connect to Google Books APIs article where you can find an example for configuring a WebServiceDataSource component.

Regards,
Todor
Progress Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
仁劭
Top achievements
Rank 1
answered on 05 Jun 2018, 08:38 AM

By the way ,Can I pass object to the report.cs ?
I'm Using Telerik MVC 
Like the picture , I dont' want the data is fixed in the report1.cs
I want the datasource is from the ReportsController passing the object to the report1.cs

Is it possible to do that ?


thx for anwer

0
Todor
Telerik team
answered on 08 Jun 2018, 07:05 AM
Hi 仁劭,

The correct way to set DataSource to a Report is in the report definition through on of the dedicated DataSource components.
In the case of an ObjectDataSource the DataSource property of the component can be any supported type, and it can be defined in an external assembly, i.e. outside report.cs.

If you would like to set the Report DataSource dynamically you can create a Custom Report Resolver where to instantiate the report, re-configure it as desired and return it to the Reporting Engine wrapped in an InstanceReportSource.

If you have other questions not related to this forum thread topic consider opening a Support ticket. This will guarantee a faster response.

Regards,
Todor
Progress Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
General Discussions
Asked by
Trung
Top achievements
Rank 1
Answers by
Katia
Telerik team
Trung
Top achievements
Rank 1
仁劭
Top achievements
Rank 1
Todor
Telerik team
Share this question
or