Skip to content
This repository was archived by the owner on Sep 24, 2018. It is now read-only.
This repository was archived by the owner on Sep 24, 2018. It is now read-only.

GET request for media files results in an empty array #1959

Description

Hi

I have been trying to fetch all the media files from the REST API using restangular, but no matter how I try it fails, so I decided to test the media endpoint via PostMan app and realized that although I can see the media files json object in my browsers when I browse to /wp-json/wp/v2/media but using PostMan or using restangular it always results in an empty array.

The funny part is that during the time I was pulling my hair for getting the media files, the files showed up only once, and after one refresh they were gone forever, this could be a bug in the wp rest plugin.

Activity

  1. changed the title [-]POST request for media files results in an empty array[/-] [+]GET request for media files results in an empty array[/+] on Jan 7, 2016
  2. danielbachhuber commented on Jan 7, 2016

    @danielbachhuber
    Member

    Sorry, but it's hard to say what the problem might be without more specific details.

    It's most likely specific to your environment, and could be caused by your caching system or another plugin.

  3. danielbachhuber commented on Jan 8, 2016

    @danielbachhuber
    Member

    Could you please test again with PostMan + Authentication using JSON Basic Authentication plugin to see if you could recreate the situation on your side?

    We don't support the JSON Basic Authentication plugin. You should instead use this plugin: https://github.com/WP-API/Basic-Auth

  4. danielbachhuber commented on Jan 8, 2016

    @danielbachhuber
    Member

    Any ideas? Do you get the same results after authenticating as and admin user?

    Low and behold, I can reproduce now. Sorry about that. Debugging.

  5. added this to the 2.0 Beta 10 milestone on Jan 8, 2016
  6. added a commit that references this issue on Jan 8, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      Sponsor
      SponsoredKunjungi sekarang
      Promo