Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make proxy script support [FromForm] model binding. #2751

Merged
merged 1 commit into from
Feb 5, 2020

Conversation

maliming
Copy link
Member

@maliming maliming commented Feb 4, 2020

Resolve #2744

public Task MyMethod([FromQuery]string a, [FromForm]string b, [FromForm]TestModel input, [FromForm]TestModel input2)
{
	return Task.CompletedTask;
}

Generated script:

function(a, b, inputName, inputBirthDate, input2Name, input2BirthDate, ajaxParams) {
  return abp.ajax($.extend(true, {
	url: abp.appPath + 'api/test' + abp.utils.buildQueryString([{ name: 'a', value: a }]) + '',
	type: 'POST',
	dataType: null,
	data: 'b=' + b + '&' + 'input.Name=' + inputName + '&' + 'input.BirthDate=' + inputBirthDate + '&' + 'input2.Name=' + input2Name + '&' + 'input2.BirthDate=' + input2BirthDate
  }, $.extend(true, {}, ajaxParams, { contentType: 'application/x-www-form-urlencoded; charset=UTF-8' })));
};

@hikalkan hikalkan merged commit b27f1f3 into dev Feb 5, 2020
@hikalkan hikalkan added this to the 2.1 milestone Feb 5, 2020
@maliming maliming deleted the maliming/proxyscript branch February 5, 2020 05:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

abp can not support [FromForm]
2 participants