Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [OperationContract]
- [WebInvoke(UriTemplate = "PlaceQuestion",
- RequestFormat = WebMessageFormat.Json,
- ResponseFormat = WebMessageFormat.Json,
- Method = "POST",
- BodyStyle = WebMessageBodyStyle.Bare)]
- string PlaceQuestion(Questions question);
- <httpProtocol>
- <customHeaders>
- <add name="Access-Control-Allow-Origin" value="*"/>
- </customHeaders>
- </httpProtocol>
- var json = JSON.stringify({
- Type : 0,
- Question: "testing"
- });
- var url = 'http://localhost:49753/RestServiceImpl.svc/PlaceQuestion';
- var params = 'json=' + json;
- var headers = new Headers();
- headers.append('Content-Type', 'application/json');
- return this._http.post(url, params, {
- headers: headers
- })
- .map(res => res.json());
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement