javascript,node.js,request,imagedownload
I soved the Problem! use request-promise, no request...
javascript,node.js,request,cheerio
Solved it myself ! I hope this could help people in the future (though I felt like a complete noob) The trick was to emit an event and handle it later. var express = require('express'); var extractor = require("./extractor"); extractor('http://www.example.com'); var app = express(); app.get('/', function (req, res) { res.send('Hello...
javascript,node.js,request,npm
Use graceful-fs module, which is a drop-in replacement for the fs module. It is a wrapper around the native fs module. Quoting the docs of graceful-fs module, Queues up open and readdir calls, and retries them once something closes if there is an EMFILE error from too many file descriptors....
They could have worded it better but it basically means the same as "We'll charge you for a minimum of 1 hour based on the request limit you have set". Here's an example. Assume you are using a 40 rps settings ($100/month which is $100/720 hours). If you keep this...
node.js,request,streaming,npm-request
After more research and experimenting I've concluded that request cannot be used in this way. The simple answer is that request creates a readable stream and .pipe() methods expects a writable stream. I tried several attempts to wrap request in a transform to get by this with no luck. While...
I GOT IT ! (finally) This web server really need to know how to answer to you. Try this (it work for me) var request = require('request'); var options = { url: 'http://linguistlist.org/callconf/browse-conf-action.cfm?confid=173395', headers: { 'Accept-Encoding':'none' } }; request(options, function (err, res, body) { if (err) { console.log(err) } else...
django,post,request,content-type
As mentioned in the UPDATE, I was using Runscope to test the POST data. I realised that the error was with the way Runscope handled multipart/form-data. I raised the issue with support and got notified that Runscope does not support multipart as of now. I've copied the relevant information here:...
node.js,request,logic,use,superagent
The issue you linked to isn't linked to any commits, so all we can do is speculate on whether or not that feature was implemented and then removed, or never implemented in the first place. If you read through the src, you will see that use is only ever defined...
android,string,web-services,request,android-volley
getParam() method not working with GET request on volley.its working fine with POST methods.you have to set up complete URL with parameters.
java,spring-mvc,request,servlet-filters
You can't read the stream twice, comment the code in filter and read only in controller.
logging,request,wso2,response,wso2esb
1) In the request sequence you can get message id as <property name="msgID" expression="get-property('MessageID')"/> 2) In the response sequence we set the correlation id using: <property name="CORRELATION_ID" expression="get-property('msgID')" scope="axis2" /> Refer : https://docs.wso2.com/display/IntegrationPatterns/Correlation+Identifier...
put a body property in your options object. From https://github.com/request/request#requestoptions-callback: body - entity body for PATCH, POST and PUT requests. Must be a Buffer or String, unless json is true. If json is true, then body must be a JSON-serializable object. ...
Firstly, the Amazon webpage is encoded in ISO-8859-1, not UTF-8. This is what causes the Unicode replacement character. You can check this in the response headers. I used curl -i. Secondly, the README for requests says: encoding - Encoding to be used on setEncoding of response data. If null, the...
There are really two options here. If you happen to have the exact Cookie header you want to reproduce exactly as one big string (e.g., to have a requests-driven job take over a session you created in a browser, manually or using selenium or whatever), you can just pass that...
node.js,express,routing,routes,request
This works: here's what you need to put in your node app: var express = require('express'); var app = module.exports = express(); var proxy = require('http-proxy').createProxyServer({ host: 'http://your_blog.com', // port: 80 }); app.use('/blog', function(req, res, next) { proxy.web(req, res, { target: 'http://your_blog.com' }, next); }); app.listen(80, function(){ console.log('Listening!'); }); Then...
I think you have to override the class for test.client which, by default, uses Symfony\Bundle\FrameworkBundle\Client. Something like: <parameters> <parameter name="test.client.class">My\Bundle\AppBundle\Test\Client</parameter> </parameters> First, take a look at the base class Symfony\Component\BrowserKit\Client. If you look at the request method of this class you will find this: public function request(/* ... */) {...
python,django,view,request,username
You could just do this: class ContactWizard(SessionWizardView): template_name = "invite.html" def done(self, form_list, **kwargs): form_data = process_form_data(form_list, self.request.user) return render_to_response('invitedone.html', {'form_data': form_data}) And do not forget to require the login for the wizard view as well. Anyway as @Daniel Roseman said you may also want to rethink your design and...
It's possible this character is in your sourcecode somewhere, for instance at the end of one your scripts, like: ?>\r\n. A best practice is to never include the final ?> in each file to avoid accidental output. This recommendation is in the PSR-2 Coding Style Guide. The closing ?> tag...
javascript,jquery,razor,request,.post
post_new_activity.cshtml expecting add_activity property at POST ? , see var activity= Request["add_activity"]; . Though js at Question POST data appear to be $("#modal_activity_input").val(); wrapped in call to jQuery() , which returns a jQuery object , at $.post("post_new_activity.cshtml", $(activity) ? Try posting data as {"add_activity": activity} $.post("post_new_activity.cshtml", {"add_activity": activity}, function (data,...
android,request,android-volley
My guess would be that in the first case, the request has only been added to the RequestQueue, which is why calling cancelAll() works. In the second case, there is a slight delay between starting the request and pausing/destroying the Activity: in that delay, the HTTP request has begun. You...
Filter isn't doing what you think it is. You are looking for .each(). Filter takes a list and returns a smaller list. Each iterates over items. function writeToFile($, methodStr, fileName, modifyFunc) { return function () { // Whoever calls this function gets its innerhtml written to whatever // fileName is...
java,spring,spring-mvc,request
This is so called Content Negotiation, have a look at this link: https://spring.io/blog/2013/05/11/content-negotiation-using-spring-mvc
web-services,soap,request,soapui
If you want to save in a file all request that your Mock service recieve, simply do the follow. In your mock service open the onRequest script tab as in the follow image (this script executes each time that your service receives a request): And add the follow groovy script...
Like this: SqlCommand command = new SqlCommand("Select * from whatever where Date Between @begin and @end"); command.Parameters.Add(new SqlParameter("begin", yourbegin)); command.Parameters.Add(new SqlParameter("end", yourEnd)); ... yourBegin and yourEnd are of type DateTime......
Timeouts are not an ideal solution. What you really need is the ability to wait for a download to finish and afterwards immediately start a new download. And that a specific number of times in parallel. You could do that by using a callback. function downloadImage(src, callback){ var dst =...
The best fix is to add a type annotation here (first line): var requestOptions: Options = { url: 'https://www.wigglewoowoo.com', method: 'POST', headers: { 'Connection': 'close' }, ... ... To understand why, see this long question/answer about how object literals and index signatures interact (the case here is slightly different, but...
I haven't been able to solve the decoding error, however, I found a way around it. By writing to the file in binary mode the bytes object can be written, so no decoding is necessary: with urllib.request.urlopen(req) as response: result = response.read() # print(result) with open(subpath, 'wb') as file: file.write(result)...
Do you want to get value in form with dynamic inputs? If yes, you can try this: NameValueCollection nvc = Request.Form; foreach (var item in Request.Form.AllKeys) { //do something you want. // Examble : if(item == "A")// item will return name of input // Note: nvc[item] return value of input...
Don't build JSON by hand, use JSON.stringify data: JSON.stringify({uniqueKey: key}), Php does not populate $_POST(INPUT_POST) when the request body is JSON, only for application/x-www-form-urlencoded or multipart/form-data To get json you'll have to read it from php://input $json = file_get_contents('php://input'); $obj = json_decode($json); $uniqueKey = $obj->uniqueKey; Also you code only responds...
c++,asynchronous,boost,request,mpi
MPI does not support intrinsicly complex C++ objects such as std::string. That's why Boost.MPI serialises and correspondingly deserialises such objects when passing them around in the form of MPI messages. From a semantic point of view, the non-blocking operation started by irecv() should complete once the data has been received...
python,function,request,urllib,nonetype
You can use a try/except block around the code that's causing the issue. If the list is empty, run the next iteration of the outer for loop (untested): def searchGoFromDico(dictionary): dicoGoForEachGroup = {} for groupName in dico: taxonAndGene = dico[groupName] listeAllGoForOneGroup = [] for taxon in taxonAndGene: geneIds = taxonAndGene[taxon]...
ios,iphone,parse.com,save,request
**Cloud Code (JS) ** Parse.Cloud.define("createSale", function(request, response) { var SaleClass = Parse.Object.extend("Sale"); var sale = new SaleClass(); sale.set("contractorId", request.params.contractorId); sale.set("subtotal", request.params.subtotal); sale.save(null, { success: function (sale) { console.log(responseData); response.success(responseData); }, error: function (error) { response.error(error); console.log(error); } }); }); Share Instance of ParseCloudFunctions (Obj-C) I created a class that holds...
The phrase you want is "exponential backoff". It is a best practice in a wide variety of settings. Here are the top 4 results of a Google search for that phrase: http://en.wikipedia.org/wiki/Exponential_backoff http://docs.aws.amazon.com/general/latest/gr/api-retries.html https://developers.google.com/api-client-library/java/google-http-java-client/backoff https://msdn.microsoft.com/en-us/library/microsoft.practices.transientfaulthandling.exponentialbackoff.aspx...
Try this: $("#restaurant_website").append("<a href=" + website + ">" + website+"</a>"); ...
android,post,request,httpentity
I was reading post in stack overflow when i saw this post : java.lang.NoSuchFieldError: org.apache.http.message.BasicHeaderValueFormatter.INSTANCE android There is the solution to my problem....
If you see req.body set to something, that means the request has already been processed, so there is nothing to pipe to your file WriteStream. So you need to either move your body parsing middleware so that they are only executed for routes that need them, or (as more of...
Well you could do that in two way first: SELECT commmentId, content, date FROM comments WHERE trackId IN (SELECT trackId FROM tracks WHERE genreId = xxx); Or: SELECT c.commentId, c.content, c.date, t.genreId FROM comments c INNER JOIN tracks t ON c.trackId = t.trackId WHERE t.genreId = xxx; And I didn't...
android,rest,request,android-volley
put listener for those request for counting the responses(it is either onResponse or onErrorResponse). If count is reached to 3 then send 4th request.
call processThread() method in method run() in ClientThread using a while loop. public void run(){ while(true) processThread(); } Hope this will help.....
html,json,get,request,animated-gif
http%3A%2F%2Fi.imgur.com%2FtYqyhJT.gif Encoding means replacing slashes, colons and every single character on the U.R.L. that makes it being treated like an address, using their hex values preceded with a percent character, making it merely a parameter. Full U.R.L. then is: https://doesthisgifcontainananimation.com/http%3A%2F%2Fi.imgur.com%2FtYqyhJT.gif browser doesn't make this for you...at least not in this...
django,testing,request,action,admin
Just pass the parameter action with the action name. response = client.post(change_url, {'action': 'mark_as_read', ...}) Checked items are passed as _selected_action parameter. So code will be like this: fixtures = [MyModel.objects.create(read=False), MyModel.objects.create(read=True)] should_be_untouched = MyModel.objects.create(read=False) data = {'action': 'mark_as_read', '_selected_action': [unicode(f.pk) for f in [fixtures]]} response = client.post(change_url, data) ...
python,request,response,htmlcleaner
response.content is of <type 'str'> >>> from requests import get >>> r = get("http://www.google.com/") >>> type(r.content) <type 'str'> So just call: justext.justext(my_html_string, justext.get_stoplist("English")) ...
ajax,wordpress,request,constants
I just tested something like this and she works just fine: In functions.php: define("MY_CONSTANT", "I am a man of constant sorrows."); Wherever else: add_action( 'wp_ajax_form_request', 'form_request' ); add_action( 'wp_ajax_nopriv_form_request', 'form_request' ); function form_request() { // check your nonce if($_POST['whatever'] == 'get_my_constant_or_whatever') { header("Content-Type: application/json"); echo json_encode(MY_CONSTANT); exit; } else {...
ruby-on-rails,ruby-on-rails-4,request,minitest
My issue was that I needed to provide minitest with an initial host! From @smathy answer I knew that I needed a Mock Request for the Controller! Turns out that it is quite easy to set it in MiniTest if you know how! Rails provides an ActionDispatch::TestRequest object which in...
var formData = { client_id: '0123456789abcdef', client_secret: 'secret', code: 'abcdef' }; request.post({ url: 'https://todoist.com/oauth/access_token', form: formData }, function (err, httpResponse, body) { console.log(err, body); }); Please try this code....
The first problem may be that you didn't add the INTERNET permission in your AndroidManifest.xml. To resolve this just add this line <uses-permission android:name="android.permission.INTERNET" /> in your manifest. The other problem is that you're trying to execute a post request on main thread. It causes NetworkOnMainThreadException. You should use AsyncTask...
WeldPad Ajax request with parameters: Follow the steps: Create a container with the response format. this is my sample { "aa":"hello", "alt": "#alt#" } from here you can Create a new container Make the ajax request as follow: $.ajax({ type: "POST", url: http://weldpad.com/containerajax/44708?c=status, alt: 'xxxx', dataType: json }); Or You...
This answer is assuming they will do some action on this page, otherwise you would want a redirect. <?php $token=$_GET['token']; ?> <form method="POST"> <input type="hidden" name="token" value="<?php echo htmlentities($token, ENT_QUOTES);?>" /> <!--other form fields and submit button here--> </form> UPDATE: This was a simple answer, to be easily understood, but...
I have no idea of how you do sniffing but You are at not sending a correct request, because it misses an \r\n at the end. You are expecting the server to close the connection after the response is done. Instead you need to care about content-length header and chunked...
html,jsp,java-ee,parameters,request
Not sure what you're doing in that 2nd code segment, but you can get a hold of the form parameters using String surveyId = request.getParameter(listsurvey); It looks like you're looking for an int on the other side, but it comes in as a String so just use Integer.parseInt() after you...
php,forms,exception,laravel,request
It looks to me your problem is the url in our routes. You are repeating them. Firstly I would recommend using named routes as it will give you a bit more definition between routes. I'd change your routes to Route::put('jurors/submit',[ 'as' => 'jurors.submit', 'uses' => '[email protected]' ]); Route::get('jurors',[ 'as' =>...
I fixed it following the first solution in this link : Android, Java: HTTP POST Request Thanks for help Edit : Correct way to do the post request. HttpClient httpclient = new DefaultHttpClient(); HttpPost httppost = new HttpPost("http://www.yoursite.com/script.php"); try { // Add your data List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>(2); nameValuePairs.add(new...
ruby-on-rails,request,response
When you types in a URL, hoping for a your page. After the DNS gets resolved, the request hits a web server, which asks Rails what it has for that url. Rails goes to the routes.rb file first, which takes the URL and calls a corresponding controller action. The controller...
ios,swift,asynchronous,request
Like you said the NSURLConnection method is specifically for sending async request and acts at a higher level of abstraction. Meaning a lot of heavy lifting is done for you under the hood. Also what you do in the example is dispatching the call of the block you would supply...
Try this: select o.field1, o.field2, r.DE_Adresse from commande AS ord inner join detaillant AS ret ON ord.CO_Facturation_Adresse = ret.DE_No; I am not sure which fields you are trying to select, but the basic idea is that you select the fields that you want instead of just everything(*). Then join on...
java,sockets,http,post,request
The code you have shown is not the correct way to read HTTP requests. First off, Java has its own HttpServer and HttpsServer classes. You should consider using them. Otherwise, you have to implement the HTTP protocol manually. You need to read the input line-by-line until you reach an empty...
objective-c,osx,web-scraping,request
The request takes time and at your log statement the data has not arrived yet. Put a log of responseData in the else clause, that is when the data is available and you will see it. You do not need (or want) the the __block declaration. [[NSData alloc]initWithData:data] is unnecessary,...
If you (rightfully) can't trust the network connection between server and browser, just switch to https - problem solved. Whatever public information is exchanged can be faked in addition to the session cookie. If you only communicate on an encrypted channel, you'll need to have the attacker on the server...
rest,request,response,apiblueprint,apiary
Method names must be all-caps, as in the spec and on wire. Therefore, the "Assign access rights" line should be written as follows: ### Assign access rights [POST] ...
You can try to add second condition in rule for sending request to second backend, which is checking server status of backcend2 and then to set default backend. More info: http://cbonte.github.io/haproxy-dconv/configuration-1.5.html#7.3.2-srv_is_up frontend nginx bind *:5000 mode http acl tomcat1 path_beg -i /dologin acl tomcat2 path_beg -i /mobileapp acl is_alive srv_is_up(backend_tomcat2/tomcat02)...
As your exported function from your module is asynchronous, you need from your app to handle its result via a callback In your app: Myobject(value1, function(err, results){ //results== '{"json":"string"}' }); In your module: module.exports = function(get_this, cbk) { var request = require('request'); var options = { url: get_this, }; request(options,...
node.js,express,request,timestamp
There is Date in request headers that can be used to retrieve timestamp. If you are using Express-4.x you can use req.get(headerName) to get it. If you are using node http module try to do console.dir(req.headers). If its available you can get it from req.headers["Date"] This all are valid provided...
python,request,urllib2,user-agent
Given the content of the short responses, this becomes much easier to answer. Amazon suspects you're doing automated scraping of its site, and has served you a CAPTCHA that, if you were a human using a browser, you could solve. I'm slightly surprised it only hits you one in five...
java,struts2,request,liferay-6,interceptor
May be you can try as this. public String intercept(ActionInvocation invocation) throws Exception { final ActionContext context = invocation.getInvocationContext(); Map<String,Object> parameters = (Map<String,Object>)context.get(ActionContext.PARAMETERS); Map<String, Object> parametersCopy = new HashMap<String, Object>(); parametersCopy.putAll(parameters); parametersCopy.put("myParam", "changedValue"); context.put(ActionContext.PARAMETERS, parametersCopy); return invocation.invoke(); } ...
validation,laravel,request,laravel-5,laravel-validation
If you don't want to use your resources/lang/en/validation.php file for that purpose, you could change your ValidationServiceProvider's boot function to public function boot() { Validator::resolver(function($translator, $data, $rules, $messages, $attributes) { return new ValidatorExtended($translator, $data, $rules, $messages, $attributes); }); } Notice that I added the additional $attributes parameter. Then you can...
javascript,node.js,express,request
You're trying to call a String function from a Number. Href3 will not have the substring function because indexOf returns a Number. The line: var href4=href3.substring(0,20); Should probably be: var href4=href2.substring(0,20); ...
It's not redirecting the user when they GET /check because the POST request to /login in /check is getting redirected itself, not the actual user. Also making internal requests to internal webpages isn't the best solution for logging in. I suggest creating login() middleware like so: // Don't forget to...
ruby-on-rails,module,include,request
Rename request.rb to api_client.rb.
The response closure is executed on the main thread. If you are doing your JSON parsing there (and you have a large amount of data) it will block the main thread for a while. In that case, you should use dispatch_async for the JSON parsing and only when you are...
Write in your Servlet the following code String url = request.getHeader("referer"); This worked in my case.Hope it works for you as well...
javascript,python,django,request
The problem is that the url pattern in url.py doesn't match the url you entered. You can use the request.GET dictionary directly to read the query parameters. For this change url pattern as url(r'^loginfo/(?P<siteid>[0-9]+)', 'log_info', name='log_info'), ^loginfo/(?P<siteid>[0-9]+) matchesloginfo followed by any number of digits. This ensures that if url has...
The code is checking whether a specific item is in the shopping basket and if so, it returns the quantity for that item. It checks whether there is a shopping basket set in the cookies Request.Cookies["BesteldeArtikelen"] != null Then it checks whether an item with id has been added Request.Cookies["BesteldeArtikelen"][artikel_id.ToString()]...
The store() method of a resource controller/route doesn't take any route parameters. That means Laravel has nothing to pass as $name argument. I suppose you're passing the name in the request data itself. If that's the case you can access it with $request->input('name'). Anyways you should remove $name from the...
javascript,json,node.js,express,request
delete req.body.name should work in a javascript object check How to remove a property from a JavaScript object...
The short answer to your question is that you can't send both GET and POST using the same form. But if you want your url to look like you specified: www.website.com/topic/SomeTopic?question=1 then you're almost there. First you will need to already know the name of the topic as you have...
python-2.7,flask,request,wtforms,flask-wtforms
:) Let's see if we can clarify this a little. To your first question: As @dim suggested in his comment, You have a few options: You can submit your form to separate unique urls. That way you know which form was submitted You can create two similar but different Form...
python,css,xpath,web-scraping,request
Here are the things I would fix/improve: the code is not properly indented, you need to move the HTML-parsing code into the loop body a url whisky.de/shop/Aktuell/1 for the page number 1 would not work, instead don't specify the page number: whisky.de/shop/Aktuell/ to get the prices and titles I would...
http,request,authorization,captcha,recaptcha
Turns out we are not supposed to do that kind of tricks with reCAPTCHA. There is no support for that in API. It seems that it was part of Google's design to prevent that kind of usage. The only walkaround I could come up with is to implement a WebView...
python,django,rest,file-upload,request
I tried to fix this but in the end it was quicker and easier to switch to the Django-REST framework. The docs are so much better for Djano-REST that it was trivial to set it up and build tests. There seem to be no time savings to be had with...
javascript,node.js,stream,request,response
In the 2nd snippet, body.toUpperCase() will act immediately before any of the 'data' events have actually occurred. The call to .on() only adds the event handler so it will be called, but doesn't yet call it. You can use the 'end' event, along with 'data', to wait for all data...
This happens due to disable attribute in input box, Please make only readonly="readonly" attribute so it can get value in second page. please refer code below <input name="country" type="text" id="pais" value="<?=$qpais?>" size="1" readonly="readonly" /> ...
python,post,get,request,python-requests
You can't literally have what you ask for. A request is either GET or POST, not both. However, I think you are asking if some of the parameters can be encoded in the URL while others are form-encoded in the payload. Try this: import requests params = {'key1':'val1', 'key2':'val2'} payload...
Try to inject the @translator and use its method setLocale. ['welcome_url' => $this->router->generate("welcome")] And why did you create link in the listener? You should do it in the template using twig function called path....
change your comicUrl to this comicUrl = comicElem[0].get('src').strip("http://") comicUrl="http://"+comicUrl if 'xkcd' not in comicUrl: comicUrl=comicUrl[:7]+'xkcd.com/'+comicUrl[7:] print "comic url",comicUrl ...
javascript,node.js,request,xmlhttprequest
In a browser, XMLHttpRequest is already built in so you should only get some other library that builds on top of it if that library offers you particular features that you find useful and are worth the extra download. In the interest of keeping web pages as lean as possible,...
You have a lot of issues in your soapMessage 1. <soapenv:Envelope ..> but closing tag is </soap:Envelope> 2. There is no tag <xmlns:prod... these are parameters of <soapenv:Envelope.. 3. etc... (another mismatches) BOTTOM LINE: Make exactly the same as your working request //Put somewhere in your code NSLog("%@",soapMessage); The copy...
c#,asp.net,asp.net-mvc,post,request
You could create an object i.e. SentModel, then make sure that the Name fields from the sending site match the properties within the object. As an example: public class SentModel { public string Input1 { get; set; } public string Intput2 { get; set; } } [HttpPost] public void TestMethod(SendModel...
javascript,json,node.js,stream,request
Yes you're definitely on the right track. There are two stream libs I would point you towards, through which makes it easier to define your own streams, and JSONStream which helps to convert a binary stream (like what you get from request.get) into a stream of parsed JSON documents. Here's...
1st try success: function(data) { console.log(data); }, it should output "Count " .$count; if not try to use var dataString = {count: count}; and then you can use $("#div-to-load").html(data).fadeIn('slow'); the reason of return false .. you used the .load to load the php page .. when you load it .....
I was able to solution it with: <?php $entityBody = file_get_contents('php://input'); $file = 'webhook.txt'; // Open the file to get existing content $current = file_get_contents($file); // Append a new person to the file // Write the contents back to the file file_put_contents($file, $entityBody); error_log($webhookContent); ?> ...
I believe elements with the ids of "send" and "result", respectively do not exist at the moment when your javascript code is running, therefore the click event will not be attached to the button. You need to make sure that these elements exist when you try to get them by...
If your file has data: "sample.txt" 1111,2222,3333,4444,5555,6666,7777,8888,......(and so on) To read the file contents, you can use the file open operation: import itertools #open the file for read with open("sample.txt", "r") as fp: values = fp.readlines() #Get the values split with "," data = [map(int, line.split(",")) for line in values]...
You're performing a POST operation here. That is reserved for creating a new agent and requires that you send in a JSON request payload. See here: developers.livechatinc.com/rest-api/#create-agent What you want to do is a GET operation: developers.livechatinc.com/rest-api/#get-single-agent Instead of using PostAsync you'll need to create an HttpRequestMessage, set the Method...