Questions tagged [request]

A request is a message sent by a source to another object.

A request is a message sent by a source (e.g. computer, client, browser ...etc) to another object or device (e.g. server, computer, phone, app ...etc).

src : wikipedia link

17442 questions
152
votes
8 answers

POST data with request module on Node.JS

This module is 'request https://github.com/mikeal/request I think i'm following every step but i'm missing an argument.. var request = require('request'); request.post({ url: 'http://localhost/test2.php', body: "mes=heydude" …
Diego Torres
  • 5,308
  • 5
  • 25
  • 29
146
votes
9 answers

Get raw URL from Microsoft.AspNetCore.Http.HttpRequest

The HttpRequest class in Asp.Net 5 (vNext) contains (amongst other things) parsed details about the URL for the request, such as Scheme, Host, Path etc. I've haven't spotted anywhere yet that exposes the original request URL though - only these…
Jon Egerton
  • 40,401
  • 11
  • 97
  • 129
146
votes
5 answers

PHP GuzzleHttp. How to make a post request with params?

How to make a post request with GuzzleHttp( version 5.0 ). I am trying to do the following: $client = new \GuzzleHttp\Client(); $client->post( 'http://www.example.com/user/create', array( 'email' => 'test@gmail.com', 'name'…
Arsen
  • 3,541
  • 4
  • 14
  • 7
142
votes
2 answers

Getting binary content in Node.js using request

I was trying to GET a binary data using request, and had something like: var requestSettings = { method: 'GET', url: url, }; request(requestSettings, function(error, response, body) { // Use body as a binary Buffer } But body was always…
GilZ
  • 6,418
  • 5
  • 30
  • 40
122
votes
2 answers

PHP CURL DELETE request

I'm trying to do a DELETE http request using PHP and cURL. I have read how to do it many places, but nothing seems to work for me. This is how I do it: public function curl_req($path,$json,$req) { $ch = curl_init($this->__url.$path); $data =…
Bolli
  • 4,974
  • 6
  • 31
  • 47
121
votes
5 answers

Node.js: How to send headers with form data using request module?

I have code like the following: var req = require('request'); req.post('someUrl', { form: { username: 'user', password: '', opaque: 'someValue', logintype: '1'}, }, function (e, r, body) { console.log(body); }); How can I set headers…
Mike G.
  • 3,860
  • 3
  • 17
  • 18
121
votes
3 answers

Python send POST with header

I try to build a python script who sends a POST with parameters for extracting the result. With fiddler, I have extracted the post request who return that I want. The website uses https only. POST /Services/GetFromDataBaseVersionned HTTP/1.1 Host:…
Matt
  • 4,309
  • 7
  • 38
  • 52
120
votes
4 answers

In Flask, what is "request.args" and how is it used?

As a Flask beginner, I can't understand how request.args is used. I read somewhere that it is used to return values of query string (correct me if I'm wrong) and how many parameters request.args.get() takes. I know that when I have to store…
Deepak
  • 3,134
  • 2
  • 24
  • 24
115
votes
10 answers

Node.js - get raw request body using Express

When I use Express, and my code is: app.use(express.bodyParser()); How would I get the raw request body?
haitao_wu
  • 1,153
  • 2
  • 8
  • 6
114
votes
28 answers

How to solve flutter web api cors error only with dart code?

It seems like CORS error is well-known issue in the web field. But I tried flutter web for the first time ever and I faced critical error. The code below worked well in app version when it was running on iOS device, but when i tested the same code…
tsitixe
  • 1,851
  • 3
  • 14
  • 24
113
votes
14 answers

Get current URL of UIWebView

I already tried getting the current URL of my UIWebView with: webview.request.URL. Unfortunately the NSURL was empty. Anything wrong here? I am working with Xcode 3.2.2 beta 5. The code above should be executed in the UIWebView delegate…
danielreiser
  • 5,292
  • 5
  • 31
  • 43
112
votes
6 answers

What are Content-Language and Accept-Language?

I have seen the HTTP headers of Content-Language and Accept-Language, could someone explain what these are for and the difference between them? I have a multilingual site and wondering should I be setting both to the sites current selected language,…
amateur
  • 43,371
  • 65
  • 192
  • 320
105
votes
1 answer

How to post raw body data with curl?

Before you post this as a duplicate; I've tried many of the suggestions I found around SO. So far I've been using postman to post data to a Java web service. That works great as follows: I now want to do the same using curl, so I tried it using the…
kramer65
  • 50,427
  • 120
  • 308
  • 488
105
votes
7 answers

How to get data out of a Node.js http get request

I'm trying to get my function to return the http get request, however, whatever I do it seems to get lost in the ?scope?. I'm quit new to Node.js so any help would be appreciated function getData(){ var http = require('http'); var str = ''; …
Daryl Rodrigo
  • 1,387
  • 2
  • 11
  • 19
103
votes
9 answers

AWS Lambda Error: "Cannot find module '/var/task/index'"

Node.js Alexa Task Issue I'm currently coding a Node.js Alexa Task via AWS Lambda, and I have been trying to code a function that receives information from the OpenWeather API and parses it into a variable called weather. The relevant code is as…