Comments (12)
You should try without the "Authorization: " part:
wc.Headers[HttpRequestHeader.Authorization] = "Bearer $MYTOKEN";
from wit.
WoW That's a quick reply!
Now Im getting a (400) Bad Request.
May be the content type ?
This is the current code being executed:
using (WebClient wc = new WebClient())
{
string URI = "https://api.wit.ai/message?q=what%20time%20is%20it%3F";
wc.Headers[HttpRequestHeader.Authorization] = "Bearer BF54VOR3AJ33WKYEXEAYFFAEPJVR726V";
string HtmlResult = wc.UploadString(URI, "");
}
from wit.
It seems that .UploadString does a POST request. (http://msdn.microsoft.com/en-us/library/0645045y(v=vs.110).aspx)
You want a GET request here.
from wit.
oh man, you are good.
This is the final working code:
using (WebClient wc = new WebClient())
{
string URI = "https://api.wit.ai/message?q=what%20time%20is%20it%3F";
wc.Headers.Add("Content-Type", "text");
wc.Headers[HttpRequestHeader.Authorization] = "Bearer xxxxxxxxxxxxxxxxxxx";
string HtmlResult = wc.DownloadString(URI);
}
May be someone wants to add it somewhere for future reference for people coding in C#.
By the way, how is the result is coming encrypted? is it a JSON ??
from wit.
Yes, the HTTP response is formatted as JSON.
We'll keep this snippet of code handy, thank you :)
from wit.
How can i add multiple parameter in this coding
from wit.
using (WebClient wc = new WebClient())
{
string URI = "https://api.wit.ai/message?q=what%20time%20is%20it%3F";
wc.Headers.Add("Content-Type", "text");
wc.Headers[HttpRequestHeader.Authorization] = "Bearer xxxxxxxxxxxxxxxxxxx";
string HtmlResult = wc.DownloadString(URI);
}
I want to send multiple parameter in this code then how, this code working for me but i want this with multiple parameter pass in string. please hep me its solve my problem.
from wit.
Have you looked at other examples from the community? https://github.com/search?l=C%23&q=wit.ai+c%23&type=Repositories
from wit.
Can i get Bluedart API Format in C# Asp.net. If you have any source code regarding this please give it to me.
from wit.
Hi @02zarna, you may want to ask the community in our FB group instead
from wit.
Which FB group?
from wit.
https://www.facebook.com/groups/withackers
from wit.
Related Issues (20)
- After Outage wit.AI not working in my Unity Project HOT 1
- Traits added with with confidence to all utterances
- Intent conflict issue with wit.ai NLP HOT 2
- Inconsistent response from wit.ai HOT 2
- Intent create issue with node-wit NLP
- POST /utterances fails without obvious reason HOT 2
- Voice recognition does not work when startng the scene for a second time. HOT 2
- wit.ai apps gone missing after migrating to meta HOT 3
- ماذا اعمل
- https://wit.ai not accessible, white pages HOT 3
- Every question is returning the same intent HOT 10
- API does not return trained intent
- Immediate redirect from wit.ai/apps/[appID]/understanding to wit.ai/apps/ HOT 1
- Bad auth, check token/params HOT 1
- [Bug][Critical][Internal Server Error] Unable to create a new tag
- wit.ai hanging up HOT 1
- wit.ai feature labeling
- Wit.AI TTS and Voice Commands not returning responses HOT 1
- 1919095961875676 HOT 1
- Process Message API Error
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wit.