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
-
Hello,
When I made an request to a non-exist package, it returns 200 instead 404GET http://XXX/nuget/YYY/FindPackagesById()?id='Newtonsoft.Json'&semVerLevel=2.0.0
OK http://XXX/nuget/YYY/FindPackagesById()?id='Newtonsoft.Json'&semVerLevel=2.0.0This package does no exist in feed YYY
How can have a 404 when a package does not exist?
Thank you
-
@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.
-
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
-
@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