404 error code in API GET method with angular
See original GitHub issueWhich Category is your question related to? API
What AWS Services are you utilizing? REST service type
Provide additional details e.g. code snippets In my Angular project, I try to use the GET method to retrieve data in my DynamoDB as explained in the documentation but I have this error message:
FYI, I succeed to post a record on my DynamoDB with a PUT method.
Below the code I use to test the GET method:
getPersons() {
const apiName = 'api2a9802ce';
const path = '/persons';
this.amplifyService.api().get(apiName, path, { })
.catch(err => console.log(err.response))
}
that I call in a button on my DOM.
Any input to solve that?
Thanks for your answer,
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:7 (1 by maintainers)
Top Results From Across the Web
get request throwing 404 error in Angular 5 app - Stack Overflow
it is defaulting to where Angular itself is running, localhost:4200, not your api. You need to tell angular your api is on port...
Read more >The Angular HTTP Client - GET calls with Request Parameters
Using dev tools and checking the network traffic I can see the response with "http://localhost:4200/api/courses?page=1&pageSize=10" but nothing is visible.
Read more >How to Handle Errors with Angular Error Handling - Code Maze
The page that handles the 404 error is already created, so, let's continue on by creating a 500 (Internal server error) component.
Read more >[Solved]-Error 404 in Angular 4 HTTP Request-angular.js
move your api folder under root folder. In this case under book-store . The issue was not in the code. its about finding...
Read more >Angular WebAPI Project using .NET Core gets '404 Not Found ...
But then I'd get a 404 error. What was unusual was that if I went to https://localhost:5001/swagger that the swagger ui would come...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi @VetBoard did you manage to find a solution? It’s quite important as i want to get all items from /items.
Hi @jocactus ,
The GET operation you are trying to perform to get all the object from a path, is called a scan in dynamoDB. The Amplify CLI doesn’t currently support a scan of the dynamodb table but querying is supported.
You will have modify your path on the getPersons call as follows to get data back:
path = ‘/persons/partition_key_value’ or path = '/persons/object/partition_key_value/sort_key_value (as needed in your use case)
Please let us know if this approach works for you.