I need some help ...I am using a flutter package signalr_client for
real time web functionality to flutter app.So i want to send data to server either Http headers or query string . There is no option for signalr_client.
Finally I got answer. I sent timezone through query string by http:192.168.0.100/Chat?tmz=330'.And i get
by calling context.Request.Query["tmz"]
Related
I'm using fetch API to get data from server using POST method. It return an error: Network request failure. when I try with a Facebook movie API it works good, then I try it with Postman width same key and userId and everything is okay
this is what I have when I click on the TestAPI button
this is result in Postman width same configurations
The response that you are showing does not seems to be a JSON object (see the encoding issues) so when you try to do response.json() most likely fails because it can't parse it.
Try to log the response or do response.text() instead of response.json() to try it out.
Seems like your problem is on your php server code.
I have one question about encoding diacritic chars in API request.
I can send via postman request GET /rest/city?query=Poznań, response is correct, in server logs city?query=Poznań is changed to city?query=Pozna%C5%84.
Also I have API test written in node.js (mocha, supertest) and here request GET /rest/city?query=Poznań return empty array, in server logs request method changed to GET /rest/city?query=PoznaD.
What's wrong with encoding in my API auto tests? Why ń changed to D?
Do You know how can I changed this to fix issue.
Also in logs city?query=Łódz changes in changes in city?query=Aódz
Ok, i have solution, just city?query=${encodeURI(Łódź)}
I am doing my final year project that tracks the vehicle and displays the position on google maps,am using an arduino,GPS module and icomsat v1.1 GPRS module.Am trying to send the GPS data to a web page at my local server with no success,how do i do this, pls help :
this is how am doing it:
//set http param value
GPRS.print("AT+HTTPPARA=\"URL\",\"http://my_domain/gps_tracker.php?");
GPRS.print("visor=false");
GPRS.print("&latitude=");
GPRS.print(latitude);
GPRS.print("&longitude=");
GPRS.print(longitude);
GPRS.print("speed=");
GPRS.print(speedOTG);
GPRS.print("\"");
I suppose that you need to send the url as a single line message, using: println instead of print.
And check if you're receiving or not any data on your GPRS module, or if you're not managing it right.
Just wondering if there is anyway to save data across the line without the response coming back. i.e. Im using the objc odata sdk. If I create an employee entity on the ipad, than I save it, I dont need to receive the the saved entity back. So really its sending the data across the line than returning it for no reason. Only really need to send it across.
Any ideas on how I can set saves to be push to server and not have to wait for the return?
Thanks in advance
In the latest CTP (http://blogs.msdn.com/b/astoriateam/archive/2011/10/13/announcing-wcf-data-services-oct-2011-ctp-for-net-4-and-silverlight-4.aspx) you can use the Prefer header. The client can send the request with Prefer header set to return-no-content and the server will send an empty response back. The header is described here: https://datatracker.ietf.org/doc/html/draft-snell-http-prefer-01.
I need to POST data to a server in a different domain. That server is using SSL and expects the data to be in the form of a JSON string. I am attempting to do this from javascript.
I create the data and use JSON.stringify() to get it into the correct format. Then I send it as follows:
var url = "https://api.postageapp.com/v.1.0/send_message.json";
http=new XMLHttpRequest();
http.open("POST", url, true);
http.setRequestHeader("Content-type", "application/json");
http.setRequestHeader("Connection", "close");
// create the data in a data structure named post_data
var JSONText = JSON.stringify(post_data);
http.send(JSONText);
Doing a packet trace I see my client do a handshake with the server but then twice the server replies with "Encrypted alert" including the last time it sends a packet back. The browser debugger always shows a 405 - Method Now Allowed error.
What am I missing to get this to work? When they try it within their domain it runs fine.
You need server to return a HTTP Header like that:
header('Access-Control-Allow-Origin: *');
Live example:
Making cross domain JavaScript requests using XMLHttpRequest or XDomainRequest
You cannot do a cross domain post like that.
Alternative is to use Server side proxy (read this link for a nice explanation as to why you can't do that) or iframe approach.
Strictly speaking it should not be possible (due to security issues) however using a workaround called JSONP you can achieve this with a RESTful web service.
See the link below.
http://en.wikipedia.org/wiki/JSONP
MS has some code you can download somewhere on the internet with specific bindings the code is called.
JSONPBehaviour.cs
JSONPBindingElement.cs
JSONPBindingExtension.cs
JSONPEncoderFactory.cs