media-type Questions

1

Solved

How do I return an excel file (version: Office365) using FastAPI? The documentation seems pretty straightforward. But, I don't know what media_type to use. Here's my code: import os from fastapi im...
Garik asked 29/4, 2022 at 4:41

2

I have an ASP.NET Core Service that produces both JSON and XML responses. However, I like to restrict the accepted Media Type for only one action, so Swagger can only list application/json as a val...
Predominant asked 3/7, 2018 at 16:8

3

Solved

Is there a library which allows determining whether a given content type is binary or text-based? Obviously text/* is always textual, but for things like application/json, image/svg+xml or even ap...
Cenis asked 7/10, 2010 at 6:47

3

Solved

I have been learning on jax-rs. My problem is i don't know how to choose either application/XML or text/XML even i read more articles about them in Internet. Can anyone describe it simply like what...
Proprioceptor asked 30/6, 2017 at 8:40

3

I need to return zip file in my rest Api but i receive MIME media type application/zip was not found. @Produces({ "application/zip" }) public Response convertFile(){ . . . return Response.ok...
Oneidaoneil asked 14/9, 2015 at 18:37

2

Solved

This is the code that I am trying to do but it doesn't work. val JSON = String.format("application/json; charset=utf-8").toMediaType() (headers as Map<String, String>).toHeaders() I did ...
Exploiter asked 5/8, 2019 at 11:50

1

I was going through Github REST API v3 doc and found the media type application/vnd.github+json. I am familiar with traditional media types such as application/json, application/xml. It seem...
Rhizomorphous asked 30/5, 2020 at 6:6

3

Solved

I am getting the following error: Apr 09, 2013 12:24:26 PM com.sun.jersey.spi.inject.Errors processErrorMessages SEVERE: The following errors and warnings have been detected with resource and/or p...
Carson asked 9/4, 2013 at 18:41

1

I'm using RestEase client library to make requests from one service to another. The interface of it looks like this public interface IImportService1ApiClient { [Put] [Header("Content-Type", "mul...
Hebner asked 6/10, 2017 at 13:3

2

Solved

I'm trying to create a Web Service that consumes an HTML which is later used to create a PDF with iText. I'm using Postman in order to send my requests to server but everytime I get the following ...
Daedal asked 6/2, 2018 at 20:23

2

Solved

I've written a REST API service that requires that all responses be JSON. However, when the Go HTTP request parser encounters an error, it returns 400 as a plain text response without ever calling ...
Hyson asked 21/8, 2017 at 17:11

1

I found that for uploading images using Android with a RequestBody, we can use MediaType.parse("image/jpeg"). However, what would be the parameter for an audio file ? Thank you in advance for you...
Miramirabeau asked 22/3, 2016 at 12:46

2

Solved

I'm trying to create a converter for a custom media-type like application/vnd.custom.hal+json. I saw this answer here, but it won't work since you don't have access to the protected constructor of ...
Veritable asked 5/11, 2014 at 16:12

3

Solved

I have a question in regards to the consumes and produces part of the @RequestMapping. I have an endpoint that I want to accept both JSON and XML and return JSON when JSON is passed in and return X...
Fishhook asked 20/10, 2014 at 17:14

1

Solved

I have configured MEDIA_TYPE_MAPPINGS for my Jersey apps. Unfortunately, this causes some trouble with a generic upload service in my app. @PUT @Path("files/{filename}") @Produces({ MediaType.APPL...
Sacking asked 6/2, 2015 at 15:42

1

Solved

I'm using Spring to create a RESTful service and I'm curious about the syntax for media-types. From my understanding, the general media-type for HAL+JSON is application/hal+json. Also, from my und...
Apace asked 12/11, 2014 at 17:4

1

Solved

I need to print MS Excel, MS Word and HTML files in a Linux CUPS server. When i try to print thses media types following occurs and this is what i've found till now: For MS Excel and MS Word file...
Etude asked 17/4, 2013 at 18:31

1

Solved

I want to use APache Tika's MediaType class to compare mediaTypes. I first use Tika to detect the MediaType. Then I want to start an action according to the MediaType. So if the MediaType is from...
Lahdidah asked 20/4, 2014 at 6:51

2

Solved

I try to upload a text file from WPF RESTful client to ASP .NET MVC WebAPI 2 website. Client code HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create("http://localhost:22678/api/Accoun...
Pyramidon asked 3/1, 2014 at 17:14

1

Solved

I want to send GET-Requests which shall be answered by my REST-API. My java programm currently supports text/plain, text/html, text/xml and application/json using the JAX-RS Reference Implementatio...
Perri asked 31/7, 2013 at 7:23

1

Solved

Given a method in a controller: public class CustomerController : ApiController { [HttpGet] public CustomerDto GetById([FromUri] int id) { . . return customerDto } } Is there a way to spe...
Iago asked 16/11, 2012 at 18:44

3

Solved

With this code: <link rel="stylesheet" type="text/css" href="media/css/mobile.css" media="handheld" /> <link rel="stylesheet" type="text/css" href="media/css/screen.css" media="scre...
Whitethroat asked 8/8, 2009 at 12:28

3

Solved

I am currently creating a set of custom media types for a RESTful api (e.g. application/vnd.mycompany.foo+xml) and I'm trying to identify the pros and cons of two different ways of exposing hyperme...
Mystagogue asked 13/8, 2009 at 13:30
1

© 2022 - 2024 — McMap. All rights reserved.