Method Method PUT is not allowed by Access-Control-Allow-Methods


#1

Hello everyone, i face some problem in meteor and DialogFLow that my error console show that Method PUT is not allowed by Access-Control-Allow-Methods in preflight response. How can i fix with that?
Thanks


#2

This is a CORS error, which needs to be set on the server to which the request is sent.

Can you provide more information? What is the code supposed to do?

What code is making the PUT request, and to where? Do you control the code where you’re making the request to?

Are you using a REST package or have you defined custom HTTP routes?


#3

I tried to make axios for helping update intent in DialogFlow and this is my axios update code:

axios.put(‘https://api.dialogflow.com/v1/intents/id?v=20150910’,
data,{
headers: {
‘Authorization’:‘Bearer Developer_Token’,
‘Content-Type’: ‘application/json’
}
});


#4

I saw it has npm package, you should try it: https://www.npmjs.com/package/dialogflow-fulfillment


#5

Just to clarify, are you replacing id in the url with a real intent id?

And same thing for the Developer_Token?


#6

Yes of course, i replaced it with real intent id and developer token. I tried to find some document regarding Method Put in meteor and then followed but still can not get the expectation output.


#7

Thank you so much, this is seem important for me.