Menu
  • HOME
  • TAGS

Ruby - How to capture and store a session cookie on login?

ruby,http,cookies

Apparently the best way to achieve cURL-like behavior in Ruby is to use Curb (cURL for Ruby). Here's my solution: require 'curb' def debug_handler return ->(data_type, data) { puts data } end c =Curl::Easy.new url = "https://some.domain.com/login.jsp" headers={} headers['User-Agent']='MyAgent' creds = [Curl::PostField.content("userid","[email protected]")] creds << Curl::PostField.content("passwd","supersecretpassword") c.url = url c.headers=headers c.enable_cookies=true...

HTTP Post in ruby NoMethodError

ruby,http

Figured it out: replace req = Net::HTTP::Post.new(uri) with req = Net::HTTP::Post.new(uri.request_uri) ...

AngularJS simple auth interceptor

ajax,angularjs,http,angular-http-interceptors

If you want to add your token to each request, and respond to any errors, your best bet would be to use an Angular HTTP interceptor. Subject to your needs, it might look something like this: $httpProvider.interceptors.push(function ($q, $state, $localStorage) { return { // Add an interceptor for requests. 'request':...

Doubts on the correctness of Microsoft Azure Multimedia Services REST API

rest,http,azure,httpverbs

REST has become a buzz word that people use for any API that works over HTTP. This API appears to be what some people would call REST level 1. Level 1 means that you use HTTP as a transport mechanism only. It doesn't respect any of the REST constraints that...

Server initiated requests

http,go,http2

Before websockets we had polling. This literally means having the client periodically (every few seconds, or whatever time period makes sense for your application), make a request to the server to find out the status of the job. An optimization many people use is "long" polling. This involves having the...

Docker container http requests limit

http,elasticsearch,docker

So, it wasn't a problem with either Docker or Elastic. Just to recap, the same script throwning PUT requests at a Elasticsearch setup locally worked, but when throwning at a container with Elasticsearch failed after a few thousand documents (20k). To note that the overal number of documents was roughtly...

Can the HTTP method “PATCH” be safely used across proxies etc.?

http,caching,filter,proxy,http-patch

The answer to this question is a moving target. As time progresses and PATCH either becomes more or less popular, the systems in the network may or may not support it. Generally only the network entities that will care about HTTP verbs will be OSI Level 3 (IP) and up...

ASP.net MVC HTTP Request error with payload

asp.net,json,asp.net-mvc,http

You need to move the data to the Request Body. In Fiddler it would be a separate input box (below the one in your screenshot). Your Headers for POST http://localhost:53660/api/pooltests become: User-Agent: Fiddler Host: localhost:53660 Content-Type: application/json Content-Length: 140 The headers Content-Type should be application/json and the Content-Length will be...

HttpTransportSE .call() method has no action

java,android,http,ksoap2

!!!! WORKING CONFIRMED !!! main public class MainActivity extends Activity{ public static String rslt,thread; SoapMiddleMan c; EditText txtZIP; TextView weather; public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); txtZIP = (EditText)findViewById(R.id.zipCode); weather = (TextView)findViewById(R.id.weather); } public void sendMessage(View view) { try{ // condition for keeping the main thread asleep thread =...

Idempotent PUT in a concurrent environment

api,rest,http,idempotent

Idempotency means that in an isolated environment multiple requests from a same client does not have any effect on the state of resource. If request from another client changes the state of the resource, than it does not break the idempotency principle. Although, if you really want to ensure that...

How to retrieve HttpPost parameters in c#

c#,http,http-post,http-post-vars

According to microsoft here: http://www.asp.net/web-api/overview/formats-and-model-binding/parameter-binding-in-aspnet-web-api You have to add "[FromBody]" in the parameter list. You can only have one of these types of parameters. Also in the chrome post extension under headers you need to enter: Name: Content-Type Value: application/json...

How are YouTube and Google accessing each others cookies?

http,cookies

Your first statement is correct - it is not possible to get/set cookies from other domains. That list of cookies shows what was set when you viewed the page, but you must remember that the page includes resources from different locations (images and scripts). When a script or an image...

Does Ruby support nonblocking HTTP requests without a third-party library?

ruby,http,asynchronous,gem,eventmachine

Based on my tests, MRI does support nonblocking HTTP requests simply by using a thread. Threads don't always allow parallelism in Ruby due to the GIL, but net/http appears to be one of the exceptions: require 'net/http' require 'benchmark' uri = URI('http://stackoverflow.com/questions/30899019/') n = 10 Benchmark.bm do |b| b.report {...

headless browsing - WWW::Mechanize and HTTP::Response

perl,http

The HTTP::Response has everything you want back from the other site: $response->is_success() will tell you if the request was successful, $response->code() will return you the HTTP Response Code, $response->header('Content-Type') will return the Content-Type HTTP Header, $response->content() will give you the response content, etc. Check out the perldoc on HTTP::Response for...

FROM Http Header not included unless it's a valid email address

asp.net,google-chrome,http,asp.net-web-api,http-headers

After your comment about Fiddler seeing the header, I was curious so I did a little test. Here is my controller code: public class FromController : ApiController { [Route("api/from")] public dynamic Get() { string from1 = null; string from2 = null; string from3 = null; from1 = this.Request.Headers.From; IEnumerable<string> headers;...

In simple RESTful design, does PATCH imply mapping to CRUD's (ORM's) “update” and PUT to “destroy”+“create” (to replace a resource)?

database,rest,http,orm,crud

Well, Both the actions actually means update, where PUT is full update and PATCH is partial update. In case of PUT you already know the identifier of the resource and the resource already exists, so it is not a create and delete action per se. Infact, you can make do...

Update model with $http using a service not triggering model change

angularjs,http,model,angularjs-service

Instead of using a global variable to share data between controllers, you can use a separate service to cache data, as Angular Service is singleton. So in your case, create a service myApp.service('modelService',function() { var model = { myTable: [], anotherTable: [] }; return model; }); Then in your factory,...

NSIS: Make async web request with query string

http,asynchronous,nsis,sendasynchronousrequest

You could try the InetBgDL plug-in but you are still stuck with having to deal with the output file. You can just dump those into $pluginsdir...

ActiveMQ http connection refused

java,http,activemq,connect

Find below a stripped down example to start the broker. Your Producer runs without any problem. activemq.xml <beans xmlns="http://www.springframework.org/schema/beans" xmlns:amq="http://activemq.apache.org/schema/core" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core.xsd"> <broker...

Handling POST request via Socket in Java

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...

Mule - Retry connection with basic flow

java,http,soap,exception-handling,mule

You need to wrap your HTTP call with the until-successful scope. Example: <until-successful objectStore-ref="objectStore" maxRetries="5" secondsBetweenRetries="60" > <http:request config-ref="HTTP_Request_Configuration" path="submit" method="POST" /> </until-successful> Reference: https://developer.mulesoft.com/docs/display/current/Until+Successful+Scope...

How does a WebHook work?

php,http,paypal,stripe-payments,webhooks

Webhooks are a way to communicate with your application. With many APIs, you send them a request and the API response is included in the response to your request. But what if the request you make is asynchronous, or if for some reason the API you're using wants to be...

Lantronix XPORT - TCP/IP tunnel to send HTTP POST requests

http,microcontroller,wireshark,pic,ethernet

I have finally found the solution! After some (logical) thinking I found that it would be the problem of the XPORT. But what could be the problem? I disabled all features of which I thought that might interfere (even though I thought this would be unlogical to cause this kind...

Python Multiplayer noughts and crosses [closed]

python,http,client,server,multiplayer

You can start from the twisted chatserver example """The most basic chat protocol possible. run me with twistd -y chatserver.py, and then connect with multiple telnet clients to port 1025 """ from twisted.protocols import basic class MyChat(basic.LineReceiver): def connectionMade(self): print "Got new client!" self.factory.clients.append(self) def connectionLost(self, reason): print "Lost a...

AngularJS $http request using forEach inside of Controller

angularjs,http,foreach

You are trying to log $scope.infos without waiting until requests complete and push loaded response data to array. The answer here is using Promises for providing callback to fire once all requests resolve and push their respective data: app.controller('mainController', function($scope, $http, $q) { var url = 'https://api.twitch.tv/kraken/channels/'; $scope.channels = ["freecodecamp",...

Does libcurl load complete page in single shot?

c++,http,libcurl

libcurl does not automatically send any sub-requests for any links in the requested resource. This would be a completely unreasonable behaviour for any linked media. To retrieve linked media, you have to extract the links from the resource you initially retrieve, and then do separate requests for them as needed...

How can i added default header for DELETE in angular js

javascript,angularjs,django,rest,http

Per Angular $http document, Angular only have three default headers configuration: common, put and post. To add headers for an HTTP method other than POST or PUT, simply add a new object with the lowercased HTTP method name as the key $httpProvider.defaults.headers.get = { 'My-Header' : 'value' }. So in...

What headers must be processed in a specific order in an HTTP response?

http,header,httpresponse

Check out Chapter 3, section 3.4.0 and 3.4.1 of your text. To prevent browsers from getting confused and showing source code without fully rendering it, as plain text, or a server side script, which would be a security risk, MIME is used to create a processing order. Two header which...

how can I create a URL/site to send a HTTP 204 or HTTP 403 response?

objective-c,http,servlets,post,ios7

You certainly can implement your own web service to return those HTTP responses. For testing your app you can use services like httpbin.org For example: To get a 403 response, simply send a request to http://httpbin.org/status/403 ...

Django doesn't parse a custom http accept header

python,django,http,django-views,django-rest-framework

Try defining a custom renderer and setting the media_type attribute. from rest_framework.renderers import JSONRenderer class MyRenderer(JSONRenderer): media_type = 'application/vdn.name.v1+json' Then enable your renderer (see the docs for more info) REST_FRAMEWORK = { 'DEFAULT_RENDERER_CLASSES': ( 'path.to.MyRenderer', 'rest_framework.renderers.JSONRenderer', 'rest_framework.renderers.BrowsableAPIRenderer', ) } ...

Accessing objects returned from a factory

javascript,angularjs,http,ionic-framework,ionic

I think that your problem may be related to promises. Bear in mind that when you use $http you're creating promises and you should use the corresponding callbacks when using the return data. In the service you're already using .then method, but you aren't actually returning anything from the service...

Mocking/Testing HTTP Get Request

java,unit-testing,http,junit,mockito

Part of the problem is that you're not breaking things down into interfaces. You need to wrap getContent into an interface and provide a concrete class implementing the interface. This concrete class will then need to be passed into any class that uses the original getContent. (This is essentially dependency...

Which Http error/status code is the appropriate?

javascript,http

Both scenarios that you described are server errors. Regardless if it was a DB operation that fails or you server-side code didn't handle an error (unhandled error). Therefore, for the Front-end point of view, A server error has occurred (500 error status). Now, differentiating an custom application error from an...

How to make a jax-rs end point accept any type of http request?

http,jax-rs,resteasy

Short answer: Yes, you can annotate a method with @OPTIONS, @HEAD, @GET, @POST, @PUT, @DELETE and the resource method should be called on all of these methods. Long answer: You should not! Every HTTP method has it's semantic. A @GET is a 'safe' method because it is intended for reading...

C++ Winsock programming, receiving no response from HTTP protocol

c++,sockets,http,tcp,ip

The HTTP protocol requires all header lines to be ended with CRLF and an empty line to follow. You have all header lines without any line breaks. char message[] = "GET http://www.nasa.gov/index.html HTTP/1.1" "Host: www.nasa.gov" "Accept: */*" "Accept-Language: en-us" "Connection: keep-alive" "User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)"; This...

AngularJS / OAuth 2 transport-layer security

angularjs,http,oauth-2.0,http-post

You have syntax error, therefore JS wont make the HTTP Post request, Try this: $http.post(myURL, 'grant_type=password&username=' + userName + '&password=' + passWord, { headers: { 'Content-Type': 'application/x-www-form-urlencoded', 'Authorization': 'Basic ' + btoa(secretWord) } }). success(function (response) { console.log(response.data); }). error(function (response) { console.log(response.status); }); ...

Purpose of Pseudo/Colon Header Fields

http,networking,http-headers,protocols,http2

The purpose of the pseudo header fields was to unify the way the request/response information was carried in SPDY and later in HTTP/2 (which is based on SPDY). When SPDY was designed (but also HTTP/2) there was a need to transport request or response information that is formatted in different...

Could not load type from assembly 'App_Code'

c#,asp.net,http

Remove the App_Code from your configuration setting. In your web.config it should look like below. Even the MSDN document you linked, shows the same way of registering. <httpModules> <add name="LanguageSettingModule" type="LanguageModule" /> </httpModules> ...

Chrome Extension : How to intercept requested urls? [closed]

google-chrome,http,google-chrome-extension

JavaScript Code : The following example illustrates how to block all requests to www.evil.com: chrome.webRequest.onBeforeRequest.addListener( function(details) { return {cancel: details.url.indexOf("://www.evil.com/") != -1}; }, {urls: ["<all_urls>"]}, ["blocking"]); The following example achieves the same goal in a more efficient way because requests that are not targeted to www.evil.com do not need to...

request.headers['HTTP_AUTH_TOKEN'] does not work for https server

ruby-on-rails,http

It turns out that I need to use key HTTP_X_AUTH_TOKEN in order to get the value. And I also need to prepend X- to all my custom headers, otherwise the web server won't be able to recognize the custom headers.

how make Sync or Async HTTP Post/Get in Android Studio

android,http,android-studio

The example I have posted below is based on an example that I found on the Android Developer Docs. You can find that example HERE, look at that for a more comprehensive example. You will be able to make any http requests with the following import android.app.Activity; import android.os.AsyncTask; import...

Profile/account REST API naming convention

php,web-services,api,rest,http

Your resource URIs should be more or less constant, and the HTTP verb determines what action is performed, eg: /api/orders: GET: list orders POST: create new order /api/orders/{order-id}; GET: retrieve info about an order POST: create an order with the specified ID PUT: modify an order DELETE: remove an order...

Custom HTTP Header or cookies? how custom authentication/authorization helps in CSRF?

javascript,http,cors,csrf

When authentication is based on cookie, every fired request from the client will be authenticated. Whether it is a "good" - intended by application, or "bad - as a result of CSRF attack. Browser will always blindly add cookie to every request. When authentication is based, for instance, on bearer...

Which LiftResponse class is appropriate for returning an XML based file format?

xml,http,lift

JsonResponse and PlainTextResponse are helpers that ultimately return an InMemoryResponse. You can see the source code here and here respectively. You will notice that PlainTextResponse sets a mimetype of "text/html" which is not necessarily correct for XML. There is also an XmlResponse type that you can investigate here and which...

Is it possible to return a HTTP request to apache after php processing?

php,apache,http

I think what you want is X-Sendfile. Indeed, you can use mod_rewrite to let PHP deal with whatever-mime files, and then return an error or the wanted file via the X-Sendfile header (note that you’ll have to activate the eponymous module within apache). Didn’t test it though. It seems to...

nodejs head request isn't triggering events

node.js,http

The problem is that you don't declare a data or readable event handler. According to the fine manual: A Readable stream will not start emitting data until you indicate that you are ready to receive it. Instead, the stream will be put in a "paused" state indefinitely (until you start...

ActiveMQ http connection error

java,http,jms,activemq,producer

I guess you are mixing different ActiveMQ version/packaging and one of them is 5.9.0 (or before). The field sentCount exist since version 5.9.1. Version 5.9.0 was released on 14.Oct.2013 the field sentCount was added on 03.Dec.2013 ...

How to access properties inside an array and push them to a List Angularjs

json,angularjs,http,controller

have a look at this code on button click save function will be called and value will be stored in reports array. <doctype html> <html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script> </head> <body ng-app="myApp" data-ng-controller="HomeCtrl"> <button ng-click="save()">Save</button> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.15/angular.min.js"></script> <script> var app =...

How to set username and password using Rest easy client builder?

java,http,http-headers,jax-rs,resteasy

Looks like Basic Authentication. If that's the case, you just need to set the Authorization header to Basic base64encode(username:password) For example String credentials = "username:password" String base64encoded = Base64.getEncoder().encodeToString(credentials.getBytes()); Response response = target.request() .header(HttHeaders.AUTHORIZATION, "Basic " + base64Encoded).... The Base64 class I used is from Java 8. If you're not...

Constructing payload in AngularJs POST calls

javascript,angularjs,http

So I ended up doing what rkho suggested and did this: var query = { requestId: "xxxx", method: "search", include: "title, director, year" } function submitRequest(data) { query.data = []; for(var i = 0; i < data.length; i++) { var queryData = { data: { table: data[i].table || "default", field:...

koa-static not following max-age

http,koa

Are you sure this is not a problem with your browser instead of koa-static? I tried your example as is, but instead of using a browser i used curl to check out the headers: if you curl -I http://localhost:3000/img.png You will see that the max-age header is set to one...

ASP.net HTTP Post when auto-incrementing row Id

sql,asp.net,asp.net-mvc,http

That exception means your model classes do not match with the database tables exactly. If you are in a database-first scenario (you design the database and then you make the classes) then you should add an "ADO.NET Entity Data Model" to your project and select the Code First from Database...

AngularJS creates infinite loop when $http request returns error

angularjs,http

An infinite digest occurs in angular when an object on the scope is always changing. We can't be sure of what's causing this without seeing more of your code. Not sure if this is causing your problem, but your current $http.get is not correctly handling errors, i.e. your HTTP 401...

curl ignore --data starting with @ sign: don't read from file

http,curl,slack-api

If you are on a new version of cURL you can also use the --data-raw option: http://curl.haxx.se/docs/manpage.html#--data-raw A word of warning is that looking my laptop it appears Yosemite ships with an older version of cURL. In general if you're creating tools to post to Slack I'd recommend using an...

How to create the get method for the call

php,arrays,json,http,quickblox

It should be something like this: https://api.quickblox.com/push_tokens.json?push_token[environment]=production&push_token[client_identification_sequence]=aa557232bc237245ba67686484efab&device[platform]=iOS&device[udid]=5f5930e927660e6e7d8ff0548b3c404a4d16c04f ...

How to return value in Meteor.JS from HTTP.call “GET”

javascript,ajax,http,meteor,facebook-javascript-sdk

Don't pass a callback to get the HTTP to return. You're also able to pass off URL parameters quite easily: var result = HTTP.call("GET", "https://graph.facebook.com/me", { params: { access_token : Meteor.user().services.facebook.accessToken, fields : "likes.limit(5){events{picture,cover,place,name,attending_count}}" } }); console.log(result); ...

Create OAuth Signature with HMAC-SHA1 Encryption returns HTTP 401

c#,.net,http,oauth,hmac

It looks like you should sort parameters alphabetically in Header string and within GetSignatureBaseString method as described in this comment and Twitter OAuth documentation

Android Java Http Request Post

java,android,http,request

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...

HTTP Status 500 - NoSuchElementException

java,http

Look before you leap. Or more accurately, don't double-advance your Scanner. These lines are the culprit: String regel = sc.nextLine(); naam = sc.next(); pass = sc.next(); hasNextLine() is valid for the call to nextLine(), but not to subsequent next() calls. What you probably want to do is read out the...

Can I submit a form with google's recaptcha in it from my app?

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...

Basic HTTP server w/ Node JS

node.js,http,server

Here is how I would restructure your code. 'use strict'; var fs = require('fs'); var http = require('http'); var url = require('url'); var path = require('path'); function getContentType(ext) { switch (ext.toLowerCase()) { case '.html': return 'text/html; charset=UTF-8'; case '.gif': return 'image/gif'; case '.css': return 'text/css; charset=UTF-8'; case '.js': return 'application/javascript;...

Headers for security

security,http,header

You definitely don't want to put them in HTML using <meta> tags, as JavaScript can just remove them, and (correct) browsers will ignore them. You need to set them as HTTP response headers on the server, and this depends on your server / framework. You also don't want to do...

How to monitor the Internet connectivity on two PCs simultaneously?

python,http,cron,connection,monitor

I would suggest just a GET request (you just need a ping to indicate that the PC is on) sent periodically to maybe a Django server and if you query a page on the Django server, it shows a webpage indicating the status of each. In the Django server have...

Trouble connecting to ESP8266 NodeMCU Server

html,http,lua,arduino,wifi

I know nothing about NodeMCU but that is not a proper http server. For it to properly work with a browser, it should return some headers. You can try to close the connection after sending the response. Try the following: wifi.setmode(wifi.STATION) wifi.sta.config("SSID", "password") wifi.sta.connect() srv = net.createServer(net.TCP) srv:listen(80,function(conn) conn:on("receive", function(conn,...

Typehead displays wrong on certain input

angularjs,twitter-bootstrap,http,angular-ui-bootstrap

I think your best bet is to use a Custom Template, as described in the Typeahead example with the flags, instead of putting markup into your data. You'd change your data to be like this: {name: "Las Vegas McCarran International (LAS)", country: "United States", iata: "LAS"} and use a template...

Copied ssl cert to a test site, how do I remove it?

http,ssl,drupal,https,softlayer

https://www.drupal.org/https-information has some information on how to use SSL certs in drupal specifically. Since you didn't provide the actual error your browser is giving you, I'm going to guess its a domain name mismatch error (like this https://www.digicert.com/ssl-support/certificate-name-mismatch-error.htm ). Basically you will either need to access your site via the...

Android http error

android,http

A NetworkOnMainThreadException means you are trying to access the network on the main thread, try creating a new Thread and accessing the network there. The exception that is thrown when an application attempts to perform a networking operation on its main thread. (http://developer.android.com/reference/android/os/NetworkOnMainThreadException.html) ...

Converting curl command to iOS

ios,swift,http,curl

Body is not used in GET http methods. Use the following code to concat your params: extension String { /// Percent escape value to be added to a URL query value as specified in RFC 3986 /// /// This percent-escapes all characters besize the alphanumeric character set and "-", ".",...

why is it making the request twice

c#,asp.net,http,httpwebrequest

this problem solved by using RestSharp (Simple REST and HTTP API Client for .NET). var client = new RestClient("http://www.myapp.com/Tracker.json"); // client.Authenticator = new HttpBasicAuthenticator(username, password); var request = new RestRequest("", Method.POST); // execute the request RestResponse response = client.Execute(request); var content = response.Content; // raw content as string read this...

what does php's header function do?

php,function,http,header,content-type

why this code is sending "header('HTTP/1.1 200 OK');"? i know this code means that the page is Good, but why are we sending this code??_ This tells your browser that the requested script was found. The broswer can then assume it will be getting some other data as well....

$http headers is not a function - angularjs

php,angularjs,http

As Andy said already, headers is the 3rd parameter of the success callback. So you will have to do this:- success(function(data, status, headers, config) { // this callback will be called asynchronously // when the response is available }) I wasn't going to add this as an answer but doing...

Python - sending http requests as strings

python,http,get

Assuming python 3, it is recommended that you use urllib.request. But since you specifically ask for providing the HTTP message as a string, I assume you want to do low level stuff, so you can also use http.client: import http.client connection = http.client.HTTPConnection('www.python.org') connection.request('GET', '/') response = connection.getresponse() print(response.status) print(response.msg)...

My get request for http is very slow [closed]

sockets,http,get

Try to modify String sender = "GET /docs/ HTTP/1.1\n" + "Host:localhost:8080\n"; with String sender = "GET /docs/ HTTP/1.0\n" + "Host:localhost:8080\n"; HTTP/1.1 is using keepalive by default, this may be related to your problem. Last resort you can try to send a Connection: close header...

Why I got so many connection events on Node's HTTP server?

javascript,node.js,http,websocket,socket.io

The connections you're logging from the HTTP server are to be expected and are related to the resources that are being used on your HTML pages (JS, CSS, images, favicon, etc). The port numbers you're logging are the client side port numbers. While not random, they will change for every...

Swift: Filter a POST http request answer

json,uitableview,swift,http,post

Your JSON string is wrong, there's a " that shouldn't be there before the array delimiter: {"result":true,"data":"[{\"id\":\"b43bd766295 ^ Also, the " for result and data should be escaped, as they are later in the string. Example: {\"result\":true,\"data\":[{\"id\":\"b43bd766295220b23279899d025217d18e98374a\", ... After that, you're good to go: var err: NSError? let json =...

RestSharp - How do I get the numerical http response code?

c#,http,restsharp

Simply grab the ResponseCode property off of the RestResponse object and cast the enum value to int. RestResponse response = client.Execute(request); HttpStatusCode statusCode = response.StatusCode; int numericStatusCode = (int)statusCode; ...

Particular URL redirect to http if request come from particular host

apache,http,mod-rewrite,ssl,url-rewriting

You should add another RewriteCond to exclude redirect for this IP: RewriteCond %{SERVER_PORT} =80 RewriteCond %{REMOTE_ADDR} !=10.1.2.3 RewriteRule ^(.*) https://%{SERVER_NAME}%{REQUEST_URI} [R,L] ...

Simple Java Web validation Neither BindingResult nor plain target object for bean name 'number' available as request attribute

java,spring,http,web

In showHomePage method, change to @ModelAttribute("number") and: if(result.hasErrors()) { return "validation"; } return "success"; ...

POST Android json data

java,android,json,http

Add your params in JSONObject like below: JSONObject jsonObject = new JSONObject(); jsonObject .put("field", 222); JSONObject mainObject = new JSONObject(); try { mainObject .put("data",jsonObject); mainObject .put("timestamp","2015-05-13T12:23:42.648738"); } catch (JSONException e) { // TODO Auto-generated catch block e.printStackTrace(); } And change here in code: OutputStreamWriter out = new OutputStreamWriter(con.getOutputStream()); out.write(mainObject.toString()); //change...

Jquery load https url

javascript,jquery,http,https

A mixed content error happens when: you try to load secure content SSL(https) on a page served insecurely (http) served Or the opposite you try to load insecure content (http) on a page served securely SSL(https) served Your error message is warning that your calling page has been loaded in...

How can I capture data send to a webserver/website?

http

Try Fiddler. It acts as a system-wide proxy and captures all http requests and provides a way to inspect them.

Adding headers to 307 redirection

node.js,http,redirect,http-status-code-307

Is it true that you cannot add/modified 307 header except Location? No, it's not true. Running your code shows a response including both the specified status code and the extra headers: HTTP/1.1 307 Temporary Redirect Location: http://www.mytest.com?os_authType=basic Content-Type: multipart/form-data X-Atlassian-Token: no-check Date: Sat, 06 Jun 2015 13:40:41 GMT Connection:...

Mule: Migrating to the New HTTP Connector

http,mule,cxf

The solution is: wrap your element into a processor-chain As follows: <processor-chain> <cxf:jaxws-client serviceClass="com.acme.orders.v2_0.IOrderServiceBean" port="OrderServiceBean_v2_0Port" operation="getApprovedOrderOp" /> <http:request config-ref="http.request.config" path="acme-services/OrderServiceBean_v2_0" method="POST" /> </processor-chain> This is because cxf is intercepting, so after the processor chain you would have the same object as you had in your previous solution....

How to run different Django apps on different subdomain

django,http,django-urls

I have used django-subdomains. Subdomain helpers for the Django framework, including subdomain-based URL routing and reversing. Found solution at http://django-subdomains.readthedocs.org/en/latest/index.html...

Integrating PHP Curl

php,mysql,xml,http,php-curl

You can send xml data using curl with following code $input_xml = ''; //XML Data $url=''; // URL $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_POSTFIELDS, "xmlRequest=" . $input_xml); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 300); $data = curl_exec($ch); curl_close($ch); ...

golang mux HandleFunc always 404

http,go

Found solution. Change http.ListenAndServe(":8080", mx) To http.Handle("/", mx) ...

Swift: convert JSON from URL to multiple strings

json,swift,http,parsing,url

You can either use SwiftyJson or do it manually. You get the json so you do not need to convert it to NSString. First unwrap the dictionary using json! Second you need to get stuff that you want. As you see you need to get the value from "data" key...

Python exception for HTTP response codes

python,http,exception

The built-in Python exceptions are probably not a good fit for what you are doing. You will want to subclass the base class Exception, and throw your own custom exceptions based on each scenario you want to communicate. A good example is how the Python Requests HTTP library defines its...

Routing in Ionic

angularjs,http,ionic-framework

I guess you need to use parseInt() on both fields, change the line: if (articles[i].id === parseInt(articleId)) { To: if (parseInt(articles[i].id) === parseInt(articleId)) { ...

Meteor HTTP request structuring

javascript,http,meteor

This is the equivalent. It's a bit prettier in javascript. Server side code: var result = HTTP.post("https://api.locu.com/v2/venue/search", { data: { "fields": ["name", "menu_items", "location", "categories", "description"], "menu_item_queries": [{ "price": { "$ge": 15 }, "name": "steak" }], "venue_queries": [{ "location": { "locality": "San Francisco" } }], "api_key": "YOUR_API_KEY" } }); console.log(result.data);...

Method Put not Allowed in IIS 7.5 using Type Script + Angular Js + Web API Status 405

angularjs,http,typescript,iis-7.5,typescript1.4

It is likely that WebDAV is enabled and is interfering with your request. If you aren't using it, you need to get it out of the way so you can use PUT requests for your Web API. You should be able to do this using your web.config file: <system.webServer> /*...