2014-10-16 2 views
0

나는 번역 목록을 제공하는 간단한 리소스를 가지고 있습니다. get end point는 언어를 취하여 번역 사전을 반환합니다. 모든 업데이트는 단 하나의 번역에만 적용될 것이므로 패치로 적용하는 것이 적절할 것이라고 생각했습니다..NET 웹 API HttpPatch 403 forbidden 반환

내 API 컨트롤러에서 나는 잘 처리 할 수 ​​있지만 패치 엔드 포인트에 대한 호출은 403 금지 된 오류를 제공하고 이유를 이해하지 못합니다.

[HttpGet] 
    // GET api/<controller> 
    public Dictionary<string,string> Get(String id) 
    { 
     return TranslationSvc.GetTranslatedStrings(id); 
    } 



    [HttpPatch] 
    public TranslationEntry Patch(TranslationEntry data) 
    {//403 prevents this end point from ever executing 
     if (TranslationSvc.UpdateTranslation(data.Lang, "", data.Translation.Key, data.Translation.Value)) 
     { 
      return data; 
     } 
     else 
     { 
      //return a 500 error; 
      throw new HttpResponseException(HttpStatusCode.InternalServerError); 
     } 
    } 

    [HttpPut] 
    public TranslationEntry Put(TranslationEntry data) 
    {//works, but technically a put should be the full resource which is the full collection 
     if (TranslationSvc.UpdateTranslation(data.Lang, "", data.Translation.Key, data.Translation.Value)) 
     { 
      return data; 
     } 
     else 
     { 
      //return a 500 error; 
      throw new HttpResponseException(HttpStatusCode.InternalServerError); 
     } 
    } 

답변

0

이 문제점을 발견했습니다. 우리가 싱글 사인온 (single sign on behaviors)을 시뮬레이션 한 로컬 프록시에 대해 실행하고 있다는 사실을 잊어 버렸습니다. 해당 로컬 프록시는 기본적으로 GET 및 게시 작업을 거부하도록 구성되었습니다. 거짓 경보 질문에 대해 죄송합니다.