GETCATEGORYSPECIFIC : HTTP 301 ERROR
Hi,
public GetCategorySpecificsResponseType getCategorySpecific(string[]ID)
{
GetCategorySpecificsResponseType res = new GetCategorySpecificsResponseType();
try
{
var collection = new StringCollection(ID);
var categoryspecificrequest = new GetCategorySpecificsRequestType();
categoryspecificrequest.CategoryID = collection;
var detail = categoryspecificrequest.DetailLevel = new DetailLevelCodeTypeCollection();
detail.Add(DetailLevelCodeType.ReturnAll);
res = (GetCategorySpecificsResponseType)ApiCall.ExecuteRequest(categoryspecificrequest);
}
catch (Exception ex)
{
}
return res;
}
The ExecuteRequest method in the method above keeps throwing http 301 error. Could you please help me
Thank you
uk2014-olayi
1 comment
p.e.droshe_66
Hello ,
I read your question so my opinion on that is clear :
The HTTP 301 error typically indicates a "Moved Permanently" status, which means the requested resource has been permanently moved to a new location. In the context of your code, it suggests that the endpoint you're trying to access has been relocated.
To resolve the issue, you should check if the endpoint URL you're using for the API call is correct and up to date. Make sure it matches the latest API documentation and that any required parameters or headers are included correctly.
Here are a few steps you can follow to troubleshoot the issue:
Verify the endpoint URL: Double-check the URL you're using in the ApiCall.ExecuteRequest method. Ensure that it is the correct URL for the API you're trying to access.
Confirm the request format: Check if the request is being sent using the correct HTTP method (GET, POST, etc.) as specified by the API documentation. Ensure that any required request parameters are included and formatted correctly.
Review authentication requirements: If the API requires authentication, ensure that you are providing the necessary credentials or access tokens in the request headers or parameters.
Check for any changes or updates: APIs may undergo changes over time, including updates to endpoints, authentication methods, or request/response formats. Review the API documentation or any release notes to see if there have been any recent changes that could affect your code.
If the issue persists after checking these steps, it might be helpful to provide more specific information about the API you are working with, including the API documentation and the exact error message or stack trace you are encountering. This will allow for a more detailed analysis and troubleshooting of the problem.