Coder Social home page Coder Social logo

Comments (3)

Prajwalgn-07 avatar Prajwalgn-07 commented on August 12, 2024

And yeah I tried setting the body value to string instead of the json input, and set the header

  "headers": {
    "Authorization": "Bearer <Removed Token>",
    "Content-Type": "application/json"
  }

Then I am getting the HttpMediaTypeNotSupportedException which doesn't make sense

START RequestId: 1f2fab44-1d58-47a9-bad9-d9718ef5b497 Version: 3
2024-04-21T12:44:04.309Z  WARN 8 --- [fusion-ai-service] [           main] .w.s.m.s.DefaultHandlerExceptionResolver : Resolved [org.springframework.web.HttpMediaTypeNotSupportedException: Content-Type 'application/octet-stream' is not supported]
2024-04-21T12:44:04.309Z  INFO 8 --- [fusion-ai-service] [           main] c.a.s.p.internal.LambdaContainerHandler  : 127.0.0.1 null- null [09/04/2015:12:34:56Z] "POST /api/v1/inference HTTP/1.1" 415 - "-" "Custom User Agent String" combined
END RequestId: 1f2fab44-1d58-47a9-bad9-d9718ef5b497
REPORT RequestId: 1f2fab44-1d58-47a9-bad9-d9718ef5b497	Duration: 3.40 ms	Billed Duration: 4 ms	Memory Size: 512 MB	Max Memory Used: 154 MB	

And yeah I tested by locally bringing up the service using sam and . there it seems to be working fine

from aws-serverless-java-container.

mbfreder avatar mbfreder commented on August 12, 2024

Thanks for raising this. We will look into it.

from aws-serverless-java-container.

Vandita2020 avatar Vandita2020 commented on August 12, 2024

Hey @Prajwalgn-07,
I have tried to reproduce your issue and figure out the cause. In this case I think the issue is with your JSON file, and you were almost on the right path. You need to keep your body value to String instead of json. And you have to set content-type in multiValueHeaders instead of headers, something like mentioned below will work.

"multiValueHeaders":{
    "content-type":["application/json"]
  },

Please set this and let us know if you still get errors.

from aws-serverless-java-container.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.