0

I am trying to send a put request to our server, however, the server does not allow an ajax function because it does not think that it is authorized to talk to the server. I am wondering if there are other ways to send a put request that don't use the ajax function.

  • The server has no idea how you did the request. Maybe you just need to authenticate somehow? – jgillich Jul 18 '14 at 06:54
  • The real question here is is that is you server set up like that? Maybe you should address that instead. – Piwwoli Jul 18 '14 at 06:54
  • You are here speaking in term of server but in reality it seems that most browsers don't support other methods besides GET and POST – Oomph Fortuity Jul 18 '14 at 07:23
  • We have done a request in postman, and have seen that our server can take PUT requests. We cannot change how the server works, this is for a hackathon. – lonelyminstrel Jul 18 '14 at 07:24

1 Answers1

0

One possible situation is that you are being blocked by the browser for trying to make a cross-domain request. This means: the document (html file) is being loaded from <protocol, hostname, port> combination 1, but you are trying to make an ajax request to <protocol, hostname, port> combination 2.

If this is the case, and this is a hackaton - you can just disable the same-origin policy checks in your browser, such as described in this answer.

For more accurate answer, you should probably provide more details about the error you are getting.

Community
  • 1
  • 1
Lior Bar-On
  • 8,250
  • 3
  • 28
  • 41