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.

404 error code in API GET method with angular

See original GitHub issue

Which 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: capture d ecran 2018-09-16 a 19 06 31

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:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
lanbaucommented, Jul 15, 2019

Hi @VetBoard did you manage to find a solution? It’s quite important as i want to get all items from /items.

2reactions
nidsharmcommented, Sep 17, 2018

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.

Read more comments on GitHub >

github_iconTop 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 >

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