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)
- question: How to pass multiple variables to single context HOT 4
- Bug - Wit number entity doesn't recognize "zero" as a number?
- question: What is the maximum inactivity duration that lead to session timeout? HOT 5
- question: [TextToSpeech] How do I switch the language of the TTS voice using code at runtime? HOT 1
- Question - Associate Entities to Value HOT 2
- Website loading loop HOT 3
- How login/access for a partner meta account?
- Intent not being returned from utterance (either API or UI) HOT 1
- Export Error "Entity not found"
- Bug : Text overflow in modules (picture attached) HOT 1
- Ai
- Bug: Export Your Data - Entity '2095670360815588' not found HOT 1
- My app is not functioning
- Encountering Unknown Error (Code 1, Subcode 99) When Retrieving Utterances for Specific Intent
- feature request : Option to add multiple actions in one response. HOT 1
- Critical: Bot in production stopped working. Nothing works including deploying, saving version, changing version, downloading zip, etc. HOT 1
- Wit gets wrong entity for a keyword
- I cannot login in wit meta HOT 1
- Feature request: Open all utterances button
- After Outage wit.AI not working in my Unity Project HOT 1
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.