bad-request

WCF REST Service returns HTTP 400 Bad Request

孤街醉人 提交于 2019-12-12 19:12:11
问题 I've been trying to create a simple WCF RESTful web service, but it seems to work only in SOAP mode. I'm hosting my service with the local IIS. It looks really standard: [ServiceContract] public interface IMyService { [OperationContract] Guid Login(string username, string password); ... and: public class MyService : IMyService { [WebGet(UriTemplate = "login?user={user}&password={password}", BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] public Guid Login(string

WCF 400 Bad Request

风流意气都作罢 提交于 2019-12-12 12:30:38
问题 I created a simple function [OperationContract] [WebInvoke(Method = "POST", ResponseFormat = WebMessageFormat.Json)] string Start(); Definition, public String Start() { JavaScriptSerializer serializer = new JavaScriptSerializer(); return serializer.Serialize("Check"); } From browser using Javascript/Jquery, http://localhost/service1.svc tells me I have created a service and all other info.. Looks fine. I'm trying to call this using http://localhost/service1.svc/Start I get a 400 bad request

BadRequestHttpException POST REST Resource

淺唱寂寞╮ 提交于 2019-12-11 18:02:29
问题 I am attempting to create a custom REST resource. My module is as follows: /example.info.yml name: Example description: '' type: module core: 8.x version: DEV dependencies: - serialization - basic_auth - rest /src/Plugin/rest/resource/BasicGetResource.php namespace Drupal\Example\Plugin\rest\resource; use Drupal\rest\Plugin\ResourceBase; use Drupal\rest\ResourceResponse; /** * Provides an Example Resource * * @RestResource( * id = "example_resource", * label = @Translation("Example Resource")

Redirect with Bad Request Status

佐手、 提交于 2019-12-11 14:16:19
问题 I'm using Play Framework v2.2.2 (scala) and trying to do a Redirect with a 400 (Bad Request) status. Currently I'm doing redirects using reverse routing like so: Redirect(Games.Controllers.routes.SportViewController.show) I'd like to be able to specify the status of the redirect. I tried adding an additional argument to the call, but I get a compile error of: Overloaded method value [Redirect] cannot be applied to (play.api.mvc.Call, Int) In the documentation I noticed you can specify a

How to hide error message in angularjs http request?

心已入冬 提交于 2019-12-11 12:07:22
问题 I have get a request from an API, some times I would get the EXIF information, but sometimes I will get error message {"error":"no exif data"} How can I hide this error message. In chrome, the error is 400 (Bad Request) $http.get(res.getQNUrl(domain, key, "exif")) .success(function(data){ $scope.imageExifMap[key] = data }).error(function(data,status,headers,config){}) 回答1: The error message you mentioned above is browser specific. It is a browser logging functionality. Well there is a

ASP.NET Web API “400 Bad Request” on POST Request When Deploying to Test Server

…衆ロ難τιáo~ 提交于 2019-12-11 04:52:00
问题 I have a Single Page Application (SPA) with AngularJS as my front-end and .NET Web API as my backend. Everything works fine on my development machine, i.e. when I run it from Visual Studio (2015) under localhost. However, once published to our testing server, when sending POST requests to the Web API I get a "400 Bad Request" error. GET requests work fine. I am debugging it with Fiddler and when I look in the TextView tab it says "The underlying provider failed to Open". Here are some

Retrofit and Multipart Image Uploading with HTTP 400

假装没事ソ 提交于 2019-12-11 03:18:45
问题 Im about to start crying, because Ive tried many solutions and topics, but it doesn`t work. The issue: I have to upload an String (it was a bitmap, but I have base64 coded) to our lovely server, so I have created a background Thread in Android to do it, and calling the backend. I get a HTTP 400 error message, with the following message: org.springframework.web.bind.MissingServletRequestParameterException","message":"Required MultipartFile parameter 'file' is not present","path":"/backend

wsHTTPBinding over HTTPS causes Error 400 'Bad Request'

冷暖自知 提交于 2019-12-11 03:09:49
问题 I've been trying to create a simple service to allow messages to be logged onto a remote server via WCF, which all worked fine until I published the service to the live environment, which uses HTTPS. After some searching, I found that I needed to change my ServiceConfig to account for the different protocol. I used a combination of these two articles: How to configure WCF services to work through HTTPS without HTTP binding? WCF Bindings needed for HTTPS Having made the recommended changes to

Ajax SOAP Cross Domain ‘POST’ bad request 400

霸气de小男生 提交于 2019-12-11 02:38:43
问题 I was stuck on below the 'soapRequest', I try to test my netbeans connect cross domain access but keep on failing, anyone can help me point out my mistake? Add on, I installed 'Allow-Control-Allow-Origin' on my google chrome browser and also tried to browser poster plugin to test the 'get' and 'post' are work. function submitLogIn(username, passw) { var userId = document.getElementById(username).value; var userPass = document.getElementById(passw).value; var soap1 = '<soap:Envelope '; var

Jumblr API gives bad request while posting image to Tumblr

亡梦爱人 提交于 2019-12-10 15:27:31
问题 What I have I have an image File object trying to post to Tumblr using Jumblr API My problem When I try to post the image I get com.tumblr.jumblr.exceptions.JumblrException: Bad Request Response code :400 My code client = new JumblrClient(CONSUMER_KEY,SECRET_KEY); client.setToken(TOKEN, TOKEN_SECRET); User user=client.user(); userName=user.getName(); PhotoPost photoPost=client.newPost(client.user().getBlogs().get(0).getName(),PhotoPost.class); photoPost.setCaption("My Tumblr post"); photoPost