English 中文(简体)
RESST API 浏览器的 API 工程, 但不是客户端
原标题:REST API Works in Browser, But Not Client

我正在开发REST API, 发现一个非常有趣的问题。

当我在网络浏览器(我的情况是Chrome)上访问资源时,一切都很好。然而,当我使用REST客户端(Google Chrome插件、网络客户端和一个 Java Applet)访问资源时,变量的无源项传递到 API 。 这同时使用 Get 和 POPST 方法。

我完全不知道为什么会发生这种情况,而且事实证明,在将其投入生产(特别是使用POST方法)之前,很难检验方法。

请救救我!

最佳回答

乍一看,这听起来可能是两件事:

  1. You are not correctly passing API parameters via your client or applet
  2. A problem with authentication or cookie management. Does the API require any type of authorization?
  3. Are you forgetting to set a necessary HTTP header?
问题回答

您是否也控制了 API 或它是第三方 API? 如果控制了的话, 参数是全部到达还是空到? 错误代码是什么? - 403 未授权的代码( 如果密钥没有通过的话) 或因缺少参数而缺少的东西 。

用 CURL 构建命令行来尝试中间步骤来完成它, 这将使您更详细地了解返回的内容 。

面对同样的问题, 我正从不同的文件返回取取功能, 并使用使用使用效果装入它 Effect, 这在某种程度上导致应用程序无法获取信息, 最后将调取请求写入同一个文件, 并运行在使用中 Effect





相关问题
Python: Binding method

In following example I am trying to bind a method object via types.MethodType(...). It does not seem to work. Any suggestions? Thanks in advance. import types class Base: def payload(self, *args)...

Invoking an instance method without invoking constructor

Let s say I have the following class which I am not allowed to change: public class C { public C() { CreateSideEffects(); } public void M() { DoSomethingUseful(); } } and I have to call M ...

Behaviour of final static method

I have been playing around with modifiers with static method and came across a weird behaviour. As we know, static methods cannot be overridden, as they are associated with class rather than instance....

Setting the Page-Title in .Net using C# from a Class

Question, How do i set the title of a page from a class. Is it even possible? I can and have set the page title from a page itself and a usercontrol. Can I, How Do I do this via a class using C# ....

how to drag in the animation in iphone application?

Iphone application is using the static co-ordinates to reach at some points in the application,which is based on the button event. But what i want is when i drag the item than it should reach at some ...

热门标签