Skip to main content
Filter by
Sorted by
Tagged with
0 votes
2 answers
882 views

I am trying to develop an app as well as learn Kotlin. I decided to create an app that allows a User to create a story using AI, based on prompts, a sort of Text RPG game. I finished the UI, so now I ...
Alexander Mailyants's user avatar
2 votes
1 answer
214 views

Problem I have an ASP.NET Core Web API that can produce XML and JSON responses. For one of my controllers, I allow producing both XML and JSON. However, for all other endpoints, I only want to produce ...
mrbask's user avatar
  • 23
1 vote
0 answers
38 views

I'm trying to add a GraphQL route. This route has a custom ContentNegotiation plugin, which forced me to move the installation of the global ContentNegotiation plugin from Application to root Route (...
caeus's user avatar
  • 3,834
0 votes
1 answer
439 views

In the ktor app, I'm trying to read posted parameters like this : val params = call.receiveParameters() But I'm facing this error : No Default Transformations found for class io.ktor.utils.io....
ucMax's user avatar
  • 5,581
0 votes
0 answers
598 views

When sending a POST request to register a user using Postman, a 404 Not Found error is encountered. The Ktor server logs indicate a failure in resolving routes with the message: "No matched ...
Ayush Thakur's user avatar
2 votes
1 answer
1k views

Using Ktor's ContentNegotiation is very convenient and easy way, how to de-/serialize text into one's preferred format. In our case it is JSON. All the guides on the internet (server or client) will ...
shadyyx's user avatar
  • 16.1k
2 votes
1 answer
830 views

I know there are several posts about it, from people that initially didn't know how to configure the ContentNegotiation either on server or client. But I have read all the docs and I have configured ...
Sirode's user avatar
  • 637
2 votes
0 answers
118 views

I have a discussion, how to implement content negotiation for error cases. I'd like to hear your opinion or experiences to deal with this topic. Please be aware that there might be APIs dealing with ...
Ralf Ueberfuhr's user avatar
0 votes
1 answer
121 views

is there any way to make default content type? i use this @Override public void configureContentNegotiation(ContentNegotiationConfigurer configurer) { configurer.ignoreAcceptHeader(true)....
user avatar
1 vote
0 answers
60 views

New to Kotlin and Ktor. I generated Ktor app using both Jackson Serialization and Framemaker. I allowed sample code to be included. Using Chrome browser and accessing the endpoint returning text ...
M Foster's user avatar
1 vote
1 answer
820 views

In my HTML file there are several <img src="images/<filename>.jpeg"> The directory "images" holds these files: <filename>.jpeg as well as <...
jamacoe's user avatar
  • 569
0 votes
1 answer
598 views

My Rust Actix Web application provides multiple routes to the same resource with different content types. The example below works fine with curl localhost:8080/index -H "Accept:text/html but not ...
Konrad Höffner's user avatar
1 vote
0 answers
107 views

I am using CsvHelper (ver: 27.2.1). I have a Get API and i am trying to enable text/csv Accept header. So that when I initiate a Get Request from Postman with Accept header as text/csv, I get a CSV ...
Aman Kumar's user avatar
0 votes
1 answer
1k views

I want the capability to send the JSON list like List if the request Accept Header is of type application/json, but send it in a byte array(avro format) if the request Header is of type application/...
user2441441's user avatar
  • 1,397
0 votes
0 answers
395 views

I have been developing an api in c# asp.net with table relationships returning a json format as default and I'm added a custom csv formatter from WebApiContrib.Core.Formatter.Csv my problem is that ...
Noobie's user avatar
  • 55
0 votes
0 answers
322 views

I am working on a simple Flask app that has a single route that allows GET requests. If the incoming request header specifies application/json+ld in the request header, I want to return JSON-LD. As of ...
LittleRams's user avatar
1 vote
1 answer
567 views

DetectContentType, JavaScript support ? https://github.com/golang/go/blob/c3931ab1b7bceddc56479d7ddbd7517d244bfe17/src/net/http/sniff.go#L21 Is there a genuine reason behind the http Method ...
Mb175's user avatar
  • 85
0 votes
1 answer
306 views

I have my Spring app configured to use a GET parameter for content negotiation. Code is Kotlin but would work the same in Java. Config: override fun configureContentNegotiation(configurer: ...
Joe's user avatar
  • 48k
3 votes
1 answer
1k views

I'm using Cloudfront distribution with Regional API Gateway origin. For endpoints, for which I can't use caching, I still need the response body to be compressed, if request includes "Accept-...
astef's user avatar
  • 9,708
2 votes
1 answer
182 views

When serving a single-page application (SPA) that uses the History API, it's common practice to serve the application's HTML instead of a 404 response for requests to any unknown resource. If the ...
ezzatron's user avatar
  • 817
1 vote
2 answers
1k views

I've created an ASP.NET Core web application, and installed + used the Swashbuckle.AspNetCore version 6.1.5 Nuget package. This hosts the following openapi document on https://example.com/swagger/v1/...
Pieterjan's user avatar
  • 3,739
0 votes
2 answers
274 views

I'm using Spring Boot with header based content negotiation. I have one set of endpoints that are only available to a subset of clients, and the rest are public. My public endpoints are annotated like ...
whistling_marmot's user avatar
0 votes
1 answer
4k views

I have a Spring Boot application with an already working endpoint that produces an xlsx file. Now, I want to implement content negotation on this endpoint but I always receive 406 Not Acceptable. { ...
Manuel Pap's user avatar
  • 1,429
1 vote
1 answer
113 views

The Django web framework has a Browsable API and I would like to implement something similar in my ASP.NET (with ReactJS) application. Essentially, suppose that there's an API endpoint called api/test;...
Matthew Miller's user avatar
0 votes
2 answers
2k views

To start with I've read this: Spring boot - setting default Content-type header if it's not present in request The older version of this worked on spring boot 1. However when receiving request ...
Wes's user avatar
  • 7,137
0 votes
0 answers
253 views

When issuing a SPARQL CONSTRUCT query to a specific endpoint, Apache Jena library 3.14.0 issues an error message as follows. Endpoint returned Content Type: application/sparql-results+xml which is ...
Yasunori's user avatar
3 votes
1 answer
4k views

I have parameter classes with the @Searializable annotation: @Serializable data class ShowPostURL( val date: String, val titleSlug: String, override val redirectTo: String? = ...
Adam A's user avatar
  • 30.8k
0 votes
1 answer
350 views

So I am building out a custom content negotiation formatter like this for a custom data format that we need to use in our .NET Core API. using Microsoft.AspNetCore.Mvc.Formatters; using Microsoft....
Paul DeVito's user avatar
  • 1,981
-1 votes
1 answer
863 views

I have something like this: @RestController public class MyController { @GetMapping("/myAddress") public Response generateReportAsync(...) { ... } } This web service generates ...
Aurasphere's user avatar
  • 4,039
1 vote
1 answer
451 views

I am using Content Negotiation to define multiple response for the same REST API function , by changing the accept header. Accept header : application/json , should give response as json (used by ...
Karthik Udayakumar's user avatar
1 vote
0 answers
496 views

In my spring boot application, I have swagger configuration and content negotiation configuration. For the swagger to work, I need to comment out content negotiation. How to fix this? Thanks for your ...
Namagiri Sridhar's user avatar
0 votes
2 answers
901 views

E.g. Suppose we have a restful API endpoint to return orders, that can output in different formats. [GET] /orders/42 that could return xml, json or pdf. I thought that the best option, in a restful ...
Michele Carino's user avatar
3 votes
2 answers
2k views

I'd like to disable Content-Negotiation when actuator endpoints /info and /health are called here is my configs file @Configuration public class InterceptorAppConfig implements WebMvcConfigurer { ...
Alex's user avatar
  • 503
0 votes
1 answer
2k views

I created a spring starter project in eclipse . Most of the code was from this link https://www.logicbig.com/tutorials/spring-framework/spring-web-mvc/csv-msg-converter.html. I added content ...
Namagiri Sridhar's user avatar
0 votes
2 answers
369 views

I am trying to get the content of a java POJO on the browser in JSON format using spring-boot 2.1.9 and spring REST. Very basic example! But I get the exception shown on the title of this post. When I ...
andal's user avatar
  • 1
3 votes
0 answers
437 views

I wanted to get response from spring-mvc-controller either in json or xml format depending on the parameter - 'format' in the URL. I am able to achieve this using ContentNegotiation as shown in below ...
Runtime Terror - BS's user avatar
1 vote
1 answer
577 views

Basically, http2 push using http2_push_preload doesn't work if you set header Vary: Accept on your response because you are doing content negotiation using the Accept request header. I'm using content ...
techleadshare's user avatar
0 votes
2 answers
2k views

I'm refactoring a REST-API and want to add content negotiation to it. That works so far. Now I tried adding a custom xml serializer for all requests. But it is not or not properly called. The ...
Cliff Pereira's user avatar
0 votes
1 answer
2k views

while doing Content-negotiation testing mock GET returns with null in response body although response status is 200. java.lang.AssertionError: Response header 'Content-Type' Expected :application/...
Alex's user avatar
  • 503
1 vote
0 answers
2k views

I need to support XML and JSON in one of my spring-boot 1.5.12 service and the following dependencies on classpath jackson-dataformat-xml jackson-json dependencies(shipped as part of spring-web ...
Sai Surya Kattamuri's user avatar
3 votes
1 answer
2k views

I have an existing express endpoint that looks like this: app.get(`${route}/:id`, async (req, res) => { try { const id = req.params.id; const result = await dbFn(id); ...
dwjohnston's user avatar
  • 12.5k
0 votes
1 answer
204 views

I have implemented content negotiation so that a specific serializer will be used based on the accept header: XmlFormatter fmtXml = new XmlFormatter(); fmtXml.SupportedMediaTypes.Add(new System.Net....
Jeremy's user avatar
  • 46.9k
2 votes
2 answers
4k views

I have a Spring-Boot (v2.0.2) application with a RestController with 2 methods which only differ by the Accept header. A simplified version of the code is this: @RestController @RequestMapping("/...
THelper's user avatar
  • 15.7k
0 votes
1 answer
2k views

I have a Spring REST project that uses spring boot. I have declared jackson-dataformat-xml as a dependency in maven to support xml when the accept header is application/xml (and it natively accepts ...
yasgur99's user avatar
  • 868
1 vote
0 answers
354 views

I have a REST controller that streams the response in csv format using a helper method like below: public static void CsvStreamHelper(IEnumerable<T> data, Stream stream) { using (var writer ...
kovac's user avatar
  • 5,449
0 votes
1 answer
41 views

For example, if the request was GET /feed.xml HTTP/1.1 Host: www.nowhere123.com Accept: application/xml ... would it be admissible for a server to respond with a header Content-Type: application/atom+...
doesntgolf's user avatar
2 votes
1 answer
970 views

I'm reworking old rest api and need to keep compatibility with it. Old api uses servlets and works with both xml and json. The logic is following: it checks 'Content-Type' header, if it's supported ('...
igor's user avatar
  • 179
1 vote
0 answers
61 views

I'm using asp.net MVC in combination with React. My website composites from 2 parts, one for views that return React components, and another for doing works such as creating new object, logging in and ...
Homayoun Behzadian's user avatar
0 votes
1 answer
724 views

Introduction I have a question about a RestController and a Test . I have the following PostMapping: @PostMapping(path = "/download/as/zip/{zipFileName}" ) @ResponseBody public ...
Μenelaοs's user avatar
  • 24.5k
0 votes
1 answer
2k views

Requirement is to generate pdf / excel document on hitting the REST API endpoint. i.e. localhost:8080/download.xlsx -> generates a file with data in .xlsx format localhost:8080/download.pdf -> ...
Animesh's user avatar
  • 81