Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
In some tutorial , i have this request structure :
POST /apps/thinghttp/send_request HTTP/1.1
Host: api.thingspeak.com
Connection: close
Content-Type: application/x-www-form-urlencoded
Content-Length: (number of characters in message)
api_key=(thinghttp_api_key)&number={phone_number_to_call}
I am trying to understand a few things about it :
where they say "(api_key)" and "{phone number..}" do they have to be inside the brackets or do you takes out the brackets ?
What is the content length ? (they just dont say that )
I would like to test it using https://www.hurl.it , and i cant understand where goes the last line ? i know the first line is in the post field, and the others are headers . but what about the last line- where it goes in this website ?
thanks .
http://community.thingspeak.com/tutorials/twilio/make-calls-with-twilio-using-the-thinghttp-app/
No you don't have to use brackets, they are posted along with what's inside of the brackets, the { } are just used to let you know that what's inside of them has to be edited by yourself.
The length in bytes of the message body. The message body in a POST request are all post parameters and values : api_key=(thinghttp_api_key)&number={phone_number_to_call} in this case.
Those are the post parameters you send along with the http request. api_key is the name of one of the post parameter and (thinghttp_api_key) is it's value. The ampersand & is used to add another POST parameter which is number in this case followed by the value {phone_number_to_call}.
Related
This question already has an answer here:
Karate API Testing - Reusing variables in different scenarios in the same feature file
(1 answer)
Closed 2 years ago.
This is a followup from a previous question I asked Using response data from one scenario to another
I am looking to take information from a response in one url, then use it in a second url for another assertion.
Something like this:
Scenario: Search for asset
Given url "https://foo.bar.buzz"
When method get
Then status 200
* def responseItem = $.items[0].id // variable initialized from the response
Given url "https://foo.bar.buzz/" + responseItem + "/metadata"
// making request payload
When method put.....
Right now when I run this, it gets hung up on the second Given statement.
Any thoughts on how to resolve this?
As you probably figured out, the "Karate HTML report" will show you the request/response and headers, as long as you put DEBUG log level in your log4j config, and that will answer your question.
This question already has answers here:
Http Post with indy
(3 answers)
Closed 4 years ago.
trying to upload picture using idhttp + idssl to change profile photo,,
this the request payload data :
------WebKitFormBoundaryhyy5Vlgv8YpwXz7K
Content-Disposition: form-data; name="profile_pic"; filename="profilepic.jpg"
Content-Type: image/jpeg
------WebKitFormBoundaryhyy5Vlgv8YpwXz7K--
i know we should use TIdMultipartFormDataStream to include the photo but i dont know how, it supposed to be something like this UploadParams.AddFile('photo', Edit11.Text);
i know we should use TIdMultipartFormDataStream to include the photo
Yes.
but i dont know how
TIdMultipartFormDataStream only has 3 methods for adding data fields:
AddFormField() (which takes data as a string or a TStream)
AddObject() (which is deprecated)
AddFile()
Since you want to upload a file, it makes sense that you should use AddFile() (unless you open a TStream to the file, then you can use AddFormField() instead).
it supposed to be something like this UploadParams.AddFile('photo', Edit11.Text);
Assuming Edit11.Text contains the full path and filename to the photo file that you want to upload, all you need to change is 'photo' to 'profile_pic', since that is the name of the input field in your WebKit example:
UploadParams.AddFile('profile_pic', Edit11.Text);
Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 6 years ago.
Improve this question
Adding images instead of code because it doesn't show up.
I have an xquery which forms webpage. It runs on exist-db.
This xquery calls another xquery with xforms submission:
returnTable.xq returns an HTML table when run from browser directly
In this case Content-Type in response is:
You can see from submission that this HTML table should replace data in 'table' instance.
It does replace the data, but instead of HTML table I get a plain text.
I use
<xf:output value="instance('table')" mediatype="xhtml"/>
to show the table on webpage. I tried mediatype xml, text/xml and others.
So, when it is replaced I got a plain text instead of HTML table on webpage.
Should be like this (which I get in a completely different way, but do not want to use it due to poor performance):
I think it happens because response's Content-Type is Content-Type = text/javascript instaed of Content-Type = text/xml:
Do you know how can I change this?
You're looking for XQuery serialization options, which are supported by eXist DB, but differ between XQuery 1.0 and XQuery 3.0.
XQuery 1.0 option to set the content type to application/xhtml+xml:
declare option exist:serialize "method=xml media-type=application/xhtml+xml";
For XQuery 3.0, you can use standard XQuery serialization options:
declare namespace output = "http://www.w3.org/2010/xslt-xquery-serialization";
declare option output:method "xml";
declare option output:media-type "application/xhtml+xml";
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I am developing a website using ASP.NET MVC, how can I get the current location (Country, city, district, lat-lng geolocation) of each visitor browses my website depending on IP address?
It's possible to get location by using IP address of visitor. Use web-service provided by ipinfodb.com :
string url = string.Format("https://api.ipinfodb.com/v3/ip-city/?key={0}&ip={1}&format=json", APIKey, ipAddress);
using (WebClient client = new WebClient())
{
string json = client.DownloadString(url);
Location location = new JavaScriptSerializer().Deserialize<Location>(json);
return location;
}
There are several services out there that can do this. Try, for example, this one: http://geoip.nekudo.com.
An example: http://geoip.nekudo.com/api/8.8.8.8
Look for "ip geolocation rest api".
There are many geo-localization service you can use. For example, I do this way.
Put this tag inside your main .html page:
<script type="text/javascript" src="https://l2.io/ip.js?var=userIp"></script>
Than you will find a global variable called userIp with the calling ip address.
Than you can use any geolocation tool to get all the information you need.
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I am implementing URL REWRITE (IIS 7) in a client's website.
but I have a problem with the sql statement.
before I had this:
select * from 360 where titulo='"&request("titulo")&"'"
and it was ok.
an example of titulo was "Fiexpo Latinoamérica"
my old url was portfolio.asp?titulo=Fiexpo Latinoamérica
but now my new url is /portfolio/fiexpo-latinoamerica
I use ASP replace to remove the spaces and change them with an "-" among others simbols.
so now, my sql statement does not works... because there is no titulo in the database with that name.
how do I do?
I could easyle replace the - with an space, ok but I have "tildes" á é í ó ú
what do I do?????
How is that new URL generated? You should save the new URL (slug) for every item in the database so you can use that to generate the links and to search it when somebody is requesting the page.