Inedo Community Forums Forums
    • Recent
    • Tags
    • Popular
    • Login

    Welcome to the Inedo Forums! Check out the Forums Guide for help getting started.

    If you are experiencing any issues with the forum software, please visit the Contact Form on our website and let us know!

    Return 200 intead 404 when package does not exist

    Scheduled Pinned Locked Moved Support
    4 Posts 2 Posters 11 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • A Offline
      afd.compras_2365
      last edited by

      Hello,
      When I made an request to a non-exist package, it returns 200 instead 404

      GET http://XXX/nuget/YYY/FindPackagesById()?id='Newtonsoft.Json'&semVerLevel=2.0.0
      OK http://XXX/nuget/YYY/FindPackagesById()?id='Newtonsoft.Json'&semVerLevel=2.0.0

      This package does no exist in feed YYY

      How can have a 404 when a package does not exist?

      Thank you

      atrippA 1 Reply Last reply Reply Quote 0
      • atrippA Offline
        atripp inedo-engineer @afd.compras_2365
        last edited by

        @afd-compras_2365 that's the proper behavior of the /FindPackagesById() API endpoint; as far as why that's the proper behavior, you'd probably have to track down the folks at Microsoft who designed the API over ten years ago and ask them ;)

        That particular API returns a resultset; if the set has 0 items, then there are no packages with that ID found.

        1 Reply Last reply Reply Quote 0
        • A Offline
          afd.compras_2365
          last edited by

          This API is from proget, not nuget.org

          If I request to proget API findpackagesbyid a package that does not exist, it returns 200, and yes, with no content.

          My question is, is it possible proget webapi return 404?

          If not, do you know someway in nuget.exe to verify that, if does not existe return some kind of warning?

          Our problem is:
          Project A > 1.0.0

          • dependency to newtonsoft.json 11.0.0

          Project A > 1.1.0

          • dependency to newtonsoft 13.0.0

          Project B

          • dependency to A 1.0.0

          Whenever we made an update to Project A 1.1.0, if we do not insert in nuget.config feed of nuget.org, the answer is: No packages to update

          We expect: Warning: dependency constraint xpto

          atrippA 1 Reply Last reply Reply Quote 0
          • atrippA Offline
            atripp inedo-engineer @afd.compras_2365
            last edited by

            @afd-compras_2365 ProGet implements the NuGet Server API, so you can use ProGet as a private NuGet server; we did not design that API, we simply implement it

            Here is the same API call on NuGet gallery with a package that doesn't exist

            https://www.nuget.org/api/v2/FindPackagesById()?id='NotRealPackageFakeFAke'&semVerLevel=2.0.0

            I'm not sure I understand the dependency question with nuget.exe though... but in a case like this, you can just put those packages in your feeds I believe? Then you won't get update issues

            1 Reply Last reply Reply Quote 0

            Hello! It looks like you're interested in this conversation, but you don't have an account yet.

            Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

            With your input, this post could be even better 💗

            Register Login
            • 1 / 1
            • First post
              Last post
            Inedo Website Home • Support Home • Code of Conduct • Forums Guide • Documentation