question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Deployment Error when Caching Request Body on POST Method

See original GitHub issue

I’m trying to enable caching on a POST method endpoint based on the request body. When I try and deploy I get the following error (replacing sensitive info with XXXX):

  Serverless Error --------------------------------------- 
  
  An error occurred: XXXX - Invalid mapping expression specified: Validation Result: warnings : [], errors : [Invalid mapping expression specified: method.request.body] (Service: AmazonApiGateway; Status Code: 400; Error Code: BadRequestException; Request ID: a86f8247-9c10-4433-964c-386d334bfd64). 

Here are my configuration settings for the endpoint (replacing sensitive info with XXXX):

  events:
    - http:
        integration: lambda-proxy
        path: apps/XXXX/XXXX
        method: post
        cors: true
        authorizer:
          name: XXXX
          arn: >-
            XXXX
        caching:
          enabled: true
          cacheKeyParameters:
            - name: request.body

Is there something I’m missing?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
BorjaMacedocommented, Dec 5, 2019

#65 Solved this!

0reactions
fffan64commented, Apr 28, 2020

any news on this ? need caching for post body (entire or some specific keys)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Is it possible to cache POST methods in HTTP? - Stack Overflow
Some HTTP methods MUST cause a cache to invalidate an entity. This is either the entity referred to by the Request-URI, or by...
Read more >
HTTP caching - MDN Web Docs
The HTTP cache stores a response associated with a request and reuses the stored response for subsequent requests.
Read more >
Writing REST Services with RESTEasy Reactive - Quarkus
Accessing the request body. Any method parameter with no annotation will receive the method body., after it has been mapped from its HTTP ......
Read more >
Web API implementation - Best practices for cloud applications
A POST request can contain the details for multiple new resources and ... whether the data in the body of the response can...
Read more >
How to Fix a 400 Bad Request Error (Causes and Fixes) - Kinsta
The 400 Bad Request error indicates that the server cannot or process the request due to a client error. Read about the common...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found